コード例 #1
0
ファイル: fs.py プロジェクト: balamurugana/openlmi-scripts
 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
ファイル: fs.py プロジェクト: tbzatek/openlmi-scripts
 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
ファイル: fs.py プロジェクト: jsafrane/openlmi-doc
 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
ファイル: fs_cmd.py プロジェクト: rrakus/openlmi-scripts
 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)