コード例 #1
0
    def __init__(self, element, doc):
        Copyset.__init__(self, element, doc)

        try:
            _dest = element.getElementsByTagName("destination")[0]
            __dest = element.getElementsByTagName("disk")[0]
            self.destination = BootDisk(__dest, doc)
        except Exception:
            raise ComException("destination for copyset not defined")
    def __init__(self, element, doc):
        Copyset.__init__(self, element, doc)

        try:
            _dest=element.getElementsByTagName("destination")[0]
            __dest=element.getElementsByTagName("disk")[0]
            self.destination=BootDisk(__dest, doc)
        except Exception:
            raise ComException("destination for copyset not defined")
コード例 #3
0
 def __init__(self, *params, **kwds):
     """
     Valid constructors are
     __init__(element, doc)
     __init__(source, dest)
     __init__(source=source, dest=dest)
     """
     if (len(params) == 2 and isinstance(params[0], CopyObject) and isinstance(params[1], CopyObject)) or (
         kwds and kwds.has_key("source") and kwds.has_key("dest")
     ):
         source = None
         dest = None
         if len(params) == 2:
             source = params[0]
             dest = params[1]
         else:
             source = kwds["source"]
             dest = kwds["dest"]
         doc = xml.dom.getDOMImplementation().createDocument(None, self.TAGNAME, None)
         element = doc.documentElement
         element.setAttribute("type", "filesystem")
         element.appendChild(source.getElement())
         element.appendChild(dest.getElement())
         Copyset.__init__(self, element, doc)
         self.source = source
         self.dest = dest
     elif len(params) == 2:
         element = params[0]
         doc = params[1]
         Copyset.__init__(self, element, doc)
         try:
             __source = element.getElementsByTagName("source")[0]
             self.source = getCopyObject(__source, doc)
         except Exception, e:
             ComLog.getLogger(__logStrLevel__).warning(e)
             ComLog.debugTraceLog(ComLog.getLogger(__logStrLevel__))
             raise ComException(
                 'Source for filesystem copyset with name "%s" is not defined'
                 % (self.getAttribute("name", "unknown"))
             )
         try:
             __dest = element.getElementsByTagName("destination")[0]
             self.dest = getCopyObject(__dest, doc)
         except Exception, e:
             ComLog.getLogger(__logStrLevel__).warning(e)
             raise ComException(
                 'Destination for filesystem copyset with name "%s" is not defined'
                 % (self.getAttribute("name", "unknown"))
             )
コード例 #4
0
 def __init__(self, *params, **kwds):
     """
     Valid constructors are
     __init__(element, doc)
     __init__(source, dest)
     __init__(source=source, dest=dest)
     """
     if (len(params)==2 and isinstance(params[0], CopyObject) and isinstance(params[1], CopyObject)) or \
        (kwds and kwds.has_key("source") and kwds.has_key("dest")):
         source = None
         dest = None
         if len(params) == 2:
             source = params[0]
             dest = params[1]
         else:
             source = kwds["source"]
             dest = kwds["dest"]
         doc = xml.dom.getDOMImplementation().createDocument(
             None, self.TAGNAME, None)
         element = doc.documentElement
         element.setAttribute("type", "filesystem")
         element.appendChild(source.getElement())
         element.appendChild(dest.getElement())
         Copyset.__init__(self, element, doc)
         self.source = source
         self.dest = dest
     elif len(params) == 2:
         element = params[0]
         doc = params[1]
         Copyset.__init__(self, element, doc)
         try:
             __source = element.getElementsByTagName('source')[0]
             self.source = CopyObject(__source, doc)
         except Exception, e:
             ComLog.getLogger(__logStrLevel__).warning(e)
             ComLog.debugTraceLog(ComLog.getLogger(__logStrLevel__))
             raise ComException(
                 "Source for filesystem copyset with name \"%s\" is not defined"
                 % (self.getAttribute("name", "unknown")))
         try:
             __dest = element.getElementsByTagName('destination')[0]
             self.dest = CopyObject(__dest, doc)
         except Exception, e:
             ComLog.getLogger(__logStrLevel__).warning(e)
             raise ComException(
                 "Destination for filesystem copyset with name \"%s\" is not defined"
                 % (self.getAttribute("name", "unknown")))