예제 #1
0
    def search(cls, pathspec=None):
        """Search for volume groups matching ``pathspec``

        This will search for any volume groups matching ``pathspec`` and
        return an iterable that provides instance of VolumeGroup

        :returns: iterable of VolumeGroup instances
        """

        for volume in vgs(pathspec):
            yield cls(volume)
예제 #2
0
파일: base.py 프로젝트: bmildren/holland
    def search(cls, pathspec=None):
        """Search for volume groups matching ``pathspec``

        This will search for any volume groups matching ``pathspec`` and
        return an iterable that provides instance of VolumeGroup

        :returns: iterable of VolumeGroup instances
        """

        for volume in vgs(pathspec):
            yield cls(volume)
예제 #3
0
파일: base.py 프로젝트: bmildren/holland
    def lookup(cls, pathspec):
        """Lookup a volume group for ``pathspec``

        This will always return the first volume group found and raise an error
        if multiple volumes match ``pathspec``

        :returns: VolumeGroup instance
        """
        try:
            volume, = vgs(pathspec)
            return cls(volume)
        except (LVMCommandError, ValueError):
            raise LookupError("No VolumeGroup could be found for pathspec %r" %
                              pathspec)
예제 #4
0
    def lookup(cls, pathspec):
        """Lookup a volume group for ``pathspec``

        This will always return the first volume group found and raise an error
        if multiple volumes match ``pathspec``

        :returns: VolumeGroup instance
        """
        try:
            volume, = vgs(pathspec)
            return cls(volume)
        except (LVMCommandError, ValueError):
            raise LookupError("No VolumeGroup could be found for pathspec %r" %
                              pathspec)
예제 #5
0
파일: base.py 프로젝트: bmildren/holland
 def reload(self):
     """Reload this VolumeGroup"""
     self.attributes, = vgs(self.vg_name)
예제 #6
0
 def reload(self):
     """Reload this VolumeGroup"""
     self.attributes, = vgs(self.vg_name)
예제 #7
0
파일: test_raw.py 프로젝트: heryke/holland
 def test_vgs(self):
     """Test VG"""
     vol_group, = vgs(TEST_VG)
     self.assertEqual(vol_group["vg_name"], TEST_VG)
     self.assertEqual(int(vol_group["pv_count"]), 1)