コード例 #1
0
 def __init__(self, element, doc):
    super(StorageCopyset, self).__init__(element, doc)
    self.implementation=self.getElement().getAttribute("implementation")
    mylogger.debug("%s@%s Implementation: %s" %(self.getElement().tagName, self.getElement().getAttribute("name"), self.implementation))
    self.storage=Storage.getStorageObject(self.implementation, self.getElement())
    self.source=StorageCopyObject(element.getElementsByTagName("source")[0], doc, self.storage)
    self.destination=StorageCopyObject(element.getElementsByTagName("destination")[0], doc, self.storage)
コード例 #2
0
 def __init__(self, element, doc):
     super(StorageCopyset, self).__init__(element, doc)
     self.implementation = self.getElement().getAttribute("implementation")
     mylogger.debug(
         "%s@%s Implementation: %s" %
         (self.getElement().tagName, self.getElement().getAttribute("name"),
          self.implementation))
     self.storage = Storage.getStorageObject(self.implementation,
                                             self.getElement())
     self.source = StorageCopyObject(
         element.getElementsByTagName("source")[0], doc, self.storage)
     self.destination = StorageCopyObject(
         element.getElementsByTagName("destination")[0], doc, self.storage)
コード例 #3
0
class StorageCopyset(Copyset):
   """ The class for a storagecopyset. It will automatically instantiate the proper storage object and find the
   right methods to execute via the types of source and destination or the children of the disk element.
   """

   __logStrLevel__="StorageCopyset"
   def __init__(self, element, doc):
      super(StorageCopyset, self).__init__(element, doc)
      self.implementation=self.getElement().getAttribute("implementation")
      mylogger.debug("%s@%s Implementation: %s" %(self.getElement().tagName, self.getElement().getAttribute("name"), self.implementation))
      self.storage=Storage.getStorageObject(self.implementation, self.getElement())
      self.source=StorageCopyObject(element.getElementsByTagName("source")[0], doc, self.storage)
      self.destination=StorageCopyObject(element.getElementsByTagName("destination")[0], doc, self.storage)

   def doCopy(self):
      self.source.prepareAsSource()
      self.destination.prepareAsDest()
      ret=self.destination.doAction(self.getAttribute("action"), self.source)
      self.source.cleanupSource()
      self.destination.cleanupDest()

   def undoCopy(self):
      self.destination.undoRequirements()
      if isinstance(self.destination, JournaledObject):
         self.destination.replayJournal()
コード例 #4
0
class StorageCopyset(Copyset):
    """ The class for a storagecopyset. It will automatically instantiate the proper storage object and find the
    right methods to execute via the types of source and destination or the children of the disk element.
    """

    __logStrLevel__ = "StorageCopyset"

    def __init__(self, element, doc):
        super(StorageCopyset, self).__init__(element, doc)
        self.implementation = self.getElement().getAttribute("implementation")
        mylogger.debug(
            "%s@%s Implementation: %s" %
            (self.getElement().tagName, self.getElement().getAttribute("name"),
             self.implementation))
        self.storage = Storage.getStorageObject(self.implementation,
                                                self.getElement())
        self.source = StorageCopyObject(
            element.getElementsByTagName("source")[0], doc, self.storage)
        self.destination = StorageCopyObject(
            element.getElementsByTagName("destination")[0], doc, self.storage)

    def doCopy(self):
        self.source.prepareAsSource()
        self.destination.prepareAsDest()
        ret = self.destination.doAction(self.getAttribute("action"),
                                        self.source)
        self.source.cleanupSource()
        self.destination.cleanupDest()

    def undoCopy(self):
        self.destination.undoRequirements()
        if isinstance(self.destination, JournaledObject):
            self.destination.replayJournal()