Пример #1
0
 def execute(self, ns, devices=None, _all=False):
     """
     Implementation of 'fs list' command.
     """
     for fmt in fs.get_formats(ns, devices, fs.FORMAT_ALL, _all):
         name = fmt.Name
         label = fmt.ElementName
         if "FileSystemType" in fmt.properties():
             # it's CIM_LocalFileSystem
             # TODO: add filesystem size and free space
             fstype = fmt.FileSystemType
         else:
             # it must be LMI_DataFormat
             fstype = fmt.FormatTypeDescription
         # TODO: add free space when OpenLMI provides it
         yield (name, label, fstype)
Пример #2
0
 def execute(self, ns, devices=None, _all=False):
     """
     Implementation of 'fs list' command.
     """
     for fmt in fs.get_formats(ns, devices, fs.FORMAT_ALL, _all):
         name = fmt.Name
         label = fmt.ElementName
         if "FileSystemType" in fmt.properties():
             # it's CIM_LocalFileSystem
             # TODO: add filesystem size and free space
             fstype = fmt.FileSystemType
         else:
             # it must be LMI_DataFormat
             fstype = fmt.FormatTypeDescription
         # TODO: add free space when OpenLMI provides it
         yield (name, label, fstype)
Пример #3
0
 def execute(self, ns, devices=None, _all=False):
     """
     Implementation of 'fs list' command.
     """
     for fmt in fs.get_formats(ns, devices, fs.FORMAT_ALL, _all):
         name = fmt.Name
         label = fmt.ElementName
         if "FileSystemType" in fmt.properties():
             # it's CIM_LocalFileSystem
             # TODO: add filesystem size and free space
             fstype = fmt.FileSystemType
         else:
             # it must be LMI_DataFormat
             fstype = fmt.FormatTypeDescription
         size = "N/A"
         free = "N/A"
         if "FileSystemSize" in fmt.properties() and fmt.FileSystemSize:
             size = size2str(fmt.FileSystemSize, self.app.config.human_friendly)
         if "AvailableSpace" in fmt.properties() and fmt.AvailableSpace:
             free = size2str(fmt.AvailableSpace, self.app.config.human_friendly)
         yield (name, label, fstype, size, free)
Пример #4
0
 def execute(self, ns, devices=None, _all=False):
     """
     Implementation of 'fs list' command.
     """
     for fmt in fs.get_formats(ns, devices, fs.FORMAT_ALL, _all):
         device = fmt.first_associator(AssocClass="CIM_ResidesOnExtent")
         if device:
             devname = device.DeviceID
         else:
             devname = "(none)"
         name = fmt.Name
         label = fmt.ElementName
         if "FileSystemType" in fmt.properties():
             # it's CIM_LocalFileSystem
             # TODO: add filesystem size and free space
             fstype = fmt.FileSystemType
         else:
             # it must be LMI_DataFormat
             fstype = fmt.FormatTypeDescription
         # TODO: add free space when OpenLMI provides it
         yield (devname, name, label, fstype)
Пример #5
0
 def execute(self, ns, devices=None, _all=False):
     """
     Implementation of 'fs list' command.
     """
     for fmt in fs.get_formats(ns, devices, fs.FORMAT_ALL, _all):
         device = fmt.first_associator(AssocClass="CIM_ResidesOnExtent")
         if device:
             devname = device.DeviceID
         else:
             devname = "(none)"
         name = fmt.Name
         label = fmt.ElementName
         if "FileSystemType" in fmt.properties():
             # it's CIM_LocalFileSystem
             # TODO: add filesystem size and free space
             fstype = fmt.FileSystemType
         else:
             # it must be LMI_DataFormat
             fstype = fmt.FormatTypeDescription
         # TODO: add free space when OpenLMI provides it
         yield (devname, name, label, fstype)
Пример #6
0
 def execute(self, ns, devices=None, _all=False):
     """
     Implementation of 'fs list' command.
     """
     for fmt in fs.get_formats(ns, devices, fs.FORMAT_ALL, _all):
         name = fmt.Name
         label = fmt.ElementName
         if "FileSystemType" in fmt.properties():
             # it's CIM_LocalFileSystem
             # TODO: add filesystem size and free space
             fstype = fmt.FileSystemType
         else:
             # it must be LMI_DataFormat
             fstype = fmt.FormatTypeDescription
         size = "N/A"
         free = "N/A"
         if "FileSystemSize" in fmt.properties() and fmt.FileSystemSize:
             size = size2str(fmt.FileSystemSize,
                             self.app.config.human_friendly)
         if "AvailableSpace" in fmt.properties() and fmt.AvailableSpace:
             free = size2str(fmt.AvailableSpace,
                             self.app.config.human_friendly)
         yield (name, label, fstype, size, free)