예제 #1
0
 def resolveName(self):
     """
     Will automatically try to detect the specified device. Implicitly the same functionality as in
     HostDisk.resolve() is used.
     """
     from comoonics.storage.ComDevice import Device
     device = Device(self.getAttribute("name"), self.getDocument())
     cmds = device.resolveDeviceName()
     self.log.debug(
         "resolveName: setting name from %s => %s." %
         (str(self.getAttribute("name")), str(device.getDeviceName())))
     self.setAttribute("name", device.getDeviceName())
     return cmds
예제 #2
0
    def setUp(self):
        from comoonics import XmlTools
        import StringIO
        from comoonics.storage.ComDevice import Device
        from comoonics.storage.ComMountpoint import MountPoint
        from comoonics.storage.ComFileSystem import getFileSystem

        xmlfp = StringIO.StringIO(self.xml)
        doc = XmlTools.parseXMLFP(xmlfp)
        __device = doc.documentElement

        self.device = Device(__device, doc)
        __fs = __device.getElementsByTagName("filesystem")[0]
        self.filesystem = getFileSystem(__fs, doc)
        __mp = __device.getElementsByTagName("mountpoint")[0]
        self.mountpoint = MountPoint(__mp, doc)