Beispiel #1
0
 def testSCSIWWIDResolver(self):
     res=SCSIWWIDResolver()
     print "SCSIWWIDResolver.key: "+res.getKey()
   def getRestoreStdin(self, force=False):
      """ returns command string to restore a partition table
      config from sfdisk stdin
      see sfdisk < config
      """
      __cmd = [CMD_SFDISK]
      if force:
         __cmd.append("--force")
      __cmd.append(self.getDeviceName())
      return " ".join(__cmd)

   def commit(self):
      """ Method that waits for synchronized commits on underlying devices
      """
      try:
         from comoonics.tools import stabilized
         stabilized.stabilized(file=self.stabilizedfile, type=self.stabilizedtype, good=self.stabilizedgood)
      except ImportError:
         warnings.warn("Could not import a stabilization functionality to synchronized changed disk devices with depending kernel. You might think of installing comoonics-storage-py.")

# Initing the resolvers
try:
   from comoonics.scsi.ComSCSIResolver import SCSIWWIDResolver, FCTransportResolver
   res=SCSIWWIDResolver()
   HostDisk.resolver[res.getKey()]=res
   res=FCTransportResolver()
   HostDisk.resolver[res.getKey()]=res
except ImportError:
   import warnings
   warnings.warn("Could not import SCSIWWIDResolver and FCTransportResolver. Limited functionality for HostDisks might be available.")
        __cmd.append(self.getDeviceName())
        return " ".join(__cmd)

    def commit(self):
        """ Method that waits for synchronized commits on underlying devices
        """
        try:
            from comoonics.tools import stabilized
            stabilized.stabilized(file=self.stabilizedfile, type=self.stabilizedtype, good=self.stabilizedgood)
        except ImportError:
            warnings.warn("Could not import a stabilization functionality to synchronized changed disk devices with depending kernel. You might think of installing comoonics-storage-py.")

# Initing the resolvers
try:
    from comoonics.scsi.ComSCSIResolver import SCSIWWIDResolver, FCTransportResolver
    res=SCSIWWIDResolver()
    HostDisk.resolver[res.getKey()]=res
    res=FCTransportResolver()
    HostDisk.resolver[res.getKey()]=res
except ImportError:
    import warnings
    warnings.warn("Could not import SCSIWWIDResolver and FCTransportResolver. Limited functionality for HostDisks might be available.")

# $Log: ComDisk.py,v $
# Revision 1.10  2011-02-17 09:06:58  marc
# - added samesize functionality to createPartition that would not try to guess the optimal size but take what exactly what is specified.
# - fixed import for stabilized
#
# Revision 1.9  2011/02/08 13:05:02  marc
# - removed the factory constructor for ComDisk that would automatically detect if ComStorageDisk or ComHostDisk is needed.
#