Return details for the filesystem, including configured volumes.
961947
def get(self):
        
        res = self.fs.get_filesystem_details()
        res = res.to_dict()
        self.write(res)
175897
def info(self):
        
        output = '{type}\nFile path: {path}\n'.format(
            type=type(self), path=pprint_thing(self._path))
        if self.is_open:
            lkeys = sorted(list(self.keys()))
            if len(lkeys):
                keys = []
                values = []

                for k in lkeys:
                    try:
                        s = self.get_storer(k)
                        if s is not None:
                            keys.append(pprint_thing(s.pathname or k))
                            values.append(
                                pprint_thing(s or 'invalid_HDFStore node'))
                    except Exception as detail:
                        keys.append(k)
                        values.append(
                            "[invalid_HDFStore node: {detail}]".format(
                                detail=pprint_thing(detail)))

                output += adjoin(12, keys, values)
            else:
                output += 'Empty'
        else:
            output += "File is CLOSED"

        return output
550218
def GetFormatSpecification(self):
    
    format_specification = specification.FormatSpecification(
        self.type_indicator)

    # FAT volume header signature.
    format_specification.AddNewSignature(b'\x55\xaa', offset=510)

    if definitions.PREFERRED_NTFS_BACK_END == self.TYPE_INDICATOR:
      # NTFS file system signature.
      format_specification.AddNewSignature(b'NTFS    ', offset=3)

    # HFS boot block signature.
    format_specification.AddNewSignature(b'LK', offset=0)

    # HFS master directory block signature.
    format_specification.AddNewSignature(b'BD', offset=0)

    # HFS+ file system signature.
    format_specification.AddNewSignature(b'H+', offset=1024)

    # HFSX file system signature.
    format_specification.AddNewSignature(b'HX', offset=1024)

    # Ext file system signature.
    format_specification.AddNewSignature(b'\x53\xef', offset=1080)

    # ISO9660 file system signature.
    format_specification.AddNewSignature(b'CD001', offset=32769)

    # YAFFS file system signature.

    return format_specification
482167
def number_of_volumes(self):
    """"""
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    return len(self._volumes)
493076
async def get_volume_information(self) -> List[Volume]:
        """"""
        res = await self.services["audio"]["getVolumeInformation"]({})
        volume_info = [Volume.make(services=self.services, **x) for x in res]
        if len(volume_info) < 1:
            logging.warning("Unable to get volume information")
        elif len(volume_info) > 1:
            logging.debug("The device seems to have more than one volume setting.")
        return volume_info
827431
def system_info(self):
        """"""
        res = self.client.service.SystemInfo()
        res = {ustr(x[0]): x[1] for x in res[0]}

        to_str = lambda arr: '.'.join([ustr(x) for x in arr[0]])
        res['OSVersion'] = to_str(res['OSVersion'])
        res['RuntimeVersion'] = to_str(res['RuntimeVersion'])
        res['Version'] = to_str(res['Version'])

        res['Name'] = ustr(res['Name'])
        res['Server'] = ustr(res['Server'])
        res['LocalNameCheck'] = ustr(res['LocalNameCheck'])
        res['UserHostAddress'] = ustr(res['UserHostAddress'])

        return res
771144
def storage_volumes(self):
        
        # We do here some lazy loading.
        if not self._storage_volumes:
            self._storage_volumes = StorageVolumeManager(self)
        return self._storage_volumes
885968
def _get_hdds(vm_):
    '''
    
    '''
    _hdds = config.get_cloud_config_value(
        'hdds', vm_, __opts__, default=None,
        search_global=False
    )

    hdds = []

    for hdd in _hdds:
        hdds.append(
            Hdd(
                size=hdd['size'],
                is_main=hdd['is_main']
            )
        )

    return hdds
532409
def storage_volume_attachments(self):
        
        if not self.__storage_volume_attachments:
            self.__storage_volume_attachments = StorageVolumeAttachments(self.__connection)
        return self.__storage_volume_attachments
366435
public function data()
    {
        $data = [
            'filesystems' => array_keys((array)Configure::read(self::CONFIGURE_KEY)),
            'instances' => [],
        ];

        foreach ($data['filesystems'] as $filesystem) {
            $data['instances'][$filesystem] = FilesystemRegistry::retrieve($filesystem);
        }

        return $data;
    }
122769
def _get_data_volumes(vm_):
    '''
    
    '''
    ret = []
    volumes = vm_['volumes']
    for key, value in six.iteritems(volumes):
        # Verify the required 'disk_size' property is present in the cloud
        # profile config
        if 'disk_size' not in volumes[key].keys():
            raise SaltCloudConfigError(
                'The volume \'{0}\' is missing \'disk_size\''.format(key)
            )
        # Use 'HDD' if no 'disk_type' property is present in cloud profile
        if 'disk_type' not in volumes[key].keys():
            volumes[key]['disk_type'] = 'HDD'

        # Construct volume object and assign to a list.
        volume = Volume(
            name=key,
            size=volumes[key]['disk_size'],
            disk_type=volumes[key]['disk_type'],
            licence_type='OTHER'
        )

        # Set volume availability zone if defined in the cloud profile
        if 'disk_availability_zone' in volumes[key].keys():
            volume.availability_zone = volumes[key]['disk_availability_zone']

        ret.append(volume)

    return ret
303999
def get_sys_info():
    """"""
    blob = dict()
    blob["OS"] = platform.system()
    blob["OS-release"] = platform.release()
    blob["Python"] = platform.python_version()
    return blob
76256
def volumes(self):
        
        return [
            EBSVolume(res) for res in db.Resource.join(
                ResourceProperty, Resource.resource_id == ResourceProperty.resource_id
            ).filter(
                Resource.resource_type_id == ResourceType.get('aws_ebs_volume').resource_type_id,
                ResourceProperty.name == 'attachments',
                func.JSON_CONTAINS(ResourceProperty.value, func.JSON_QUOTE(self.id))
            ).all()
        ]
286480
def _dfs_usb_info(obj, parents):
    
    output = {}
    if (
        "BSD Name" in obj
        and obj["BSD Name"].startswith("disk")
        and mbed_volume_name_match.search(obj["IORegistryEntryName"])
    ):
        disk_id = obj["BSD Name"]
        usb_info = {"serial": None}
        for parent in [obj] + parents:
            if "USB Serial Number" in parent:
                usb_info["serial"] = parent["USB Serial Number"]
                break
        output[disk_id] = usb_info
    for child in obj.get("IORegistryEntryChildren", []):
        output.update(_dfs_usb_info(child, [obj] + parents))
    return output
1133798
def dirs(self):
        """"""
        contents = self.paths
        contents = (VenvDir(path.path) for path in contents if path.is_dir)
        return contents
1156882
def _disk(self):
        """"""
        mountpoints = [
            p.mountpoint for p in psutil.disk_partitions()
            if p.device.endswith(self.device)
        ]
        if len(mountpoints) != 1:
            raise CommandError("Unknown device: {0}".format(self.device))

        value = int(psutil.disk_usage(mountpoints[0]).percent)
        set_metric("disk-{0}".format(self.device), value, category=self.category)
        gauge("disk-{0}".format(self.device), value)
885310
def contents(self):
        """"""
        if not self.contents_read:
            self.contents_read = True
            base = self.path
            for entry in os.listdir(self.source_path):
                source_path = os.path.join(self.source_path, entry)
                target_path = os.path.join(base, entry)
                if os.path.isdir(source_path):
                    self.filesystem.add_real_directory(
                        source_path, self.read_only, target_path=target_path)
                else:
                    self.filesystem.add_real_file(
                        source_path, self.read_only, target_path=target_path)
        return self.byte_contents