Returns map {volume_id: mount_point}
344039
def _mount_points(self):
        
        diskutil_ls = subprocess.Popen(
            ["diskutil", "list", "-plist"], stdout=subprocess.PIPE
        )
        disks = _plist_from_popen(diskutil_ls)

        return {
            disk["DeviceIdentifier"]: disk.get("MountPoint", None)
            for disk in disks["AllDisksAndPartitions"]
        }
130854
def find_mounts(self):
        

        for mountpoint, (orig, fs, opts) in self.mountpoints.items():
            if 'bind' not in opts and (re.match(self.orig_re_pattern, orig) or
                                       (self.be_greedy and re.match(self.re_pattern, mountpoint))):
                yield mountpoint
636232
def get_volume(self, id):
        
        # If the id is actually a path
        if exists(id):
            with open(id) as file:
                size = os.lseek(file.fileno(), 0, os.SEEK_END)
            return {'path': id, 'size': size}
        return self.volume.get(id)
789538
def _get_mounts():
    '''
    
    '''
    mounts = {}
    with salt.utils.files.fopen("/proc/mounts") as fhr:
        for line in salt.utils.data.decode(fhr.readlines()):
            device, mntpnt, fstype, options, fs_freq, fs_passno = line.strip().split(" ")
            if fstype != 'xfs':
                continue
            mounts[device] = {
                'mount_point': mntpnt,
                'options': options.split(","),
            }

    return mounts
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)
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
45723
def _build_mountpoint(self, volume):
        
        self.add_volume(self._build_volume(volume))
        return {
            'sourceVolume': self.path_to_name(volume.get('host')),
            'containerPath': volume.get('container')
        }
460711
def mount_point(cls, file_path):
		
		mount = None

		for mp in cls.mounts():
			mp_path = mp.path()
			if file_path.startswith(mp_path) is True:
				if mount is None or len(mount.path()) <= len(mp_path):
					mount = mp

		return mount
40599
def volume(self):
        
        mprop = vtk.vtkMassProperties()
        mprop.SetInputData(self.tri_filter())
        return mprop.GetVolume()
778643
def transit_list_keys(self, mount_point='transit'):
        
        url = '/v1/{0}/keys?list=true'.format(mount_point)
        return self._adapter.get(url).json()
749947
def _index_mountpoints(self):
        """"""

        # find all mountponits
        self.mountpoints = {}
        # noinspection PyBroadException
        try:
            result = _util.check_output_(['mount'])
            for line in result.splitlines():
                m = re.match(r'(.+) on (.+) type (.+) \((.+)\)', line)
                if m:
                    self.mountpoints[m.group(2)] = (m.group(1), m.group(3), m.group(4))
        except Exception:
            pass
812591
def mount(self,
              fstype=None,
              options=None,
              auth_no_user_interaction=None):
        """"""
        return self._M.Filesystem.Mount(
            '(a{sv})',
            filter_opt({
                'fstype': ('s', fstype),
                'options': ('s', ','.join(options or [])),
                'auth.no_user_interaction': ('b', auth_no_user_interaction),
            })
        )
790895
def get_volume_by_id(self, id):
        
        for vol in self.conn.volumes:
            if vol.id == id:
                return vol
        raise KeyError("Volume with ID " + id + " not found")
502275
def mount(self, volume):
        

        volume._find_loopback()

        raid_status = None
        try:
            # use mdadm to mount the loopback to a md device
            # incremental and run as soon as available
            output = _util.check_output_(['mdadm', '-IR', volume.loopback], stderr=subprocess.STDOUT)

            match = re.findall(r"attached to ([^ ,]+)", output)
            if match:
                volume._paths['md'] = os.path.realpath(match[0])
                if 'which is already active' in output:
                    logger.info("RAID is already active in other volume, using %s", volume._paths['md'])
                    raid_status = 'active'
                elif 'not enough to start' in output:
                    volume._paths['md'] = volume._paths['md'].replace("/dev/md/", "/dev/md")
                    logger.info("RAID volume added, but not enough to start %s", volume._paths['md'])
                    raid_status = 'waiting'
                else:
                    logger.info("RAID started at {0}".format(volume._paths['md']))
                    raid_status = 'active'
        except Exception as e:
            logger.exception("Failed mounting RAID.")
            volume._free_loopback()
            raise SubsystemError(e)

        # search for the RAID volume
        for v in volume.disk.parser.get_volumes():
            if v._paths.get("md") == volume._paths['md'] and v.volumes:
                logger.debug("Adding existing volume %s to volume %s", v.volumes[0], volume)
                v.volumes[0].info['raid_status'] = raid_status
                volume.volumes.volumes.append(v.volumes[0])
                return v.volumes[0]
        else:
            logger.debug("Creating RAID volume for %s", self)
            container = volume.volumes._make_single_subvolume(flag='alloc', offset=0, size=volume.size)
            container.info['fsdescription'] = 'RAID Volume'
            container.info['raid_status'] = raid_status
            return container
256488
def find_bindmounts(self):
        """"""

        for mountpoint, (orig, fs, opts) in self.mountpoints.items():
            if 'bind' in opts and re.match(self.re_pattern, mountpoint):
                yield mountpoint
1027044
def volume(self):
        
        volume = ((np.pi * self.primitive.radius ** 2) *
                  self.primitive.height)
        return volume
931962
def transit_read_key(self, name, mount_point='transit'):
        
        url = '/v1/{0}/keys/{1}'.format(mount_point, name)
        return self._adapter.get(url).json()