示例#1
0
文件: base.py 项目: bmildren/holland
    def search(cls, pathspec=None):
        """Search for volumes matching ``pathspec``

        This will search for any physical volumes matching ``pathspec`` and
        return an iterable that provides instance of PhysicalVolume

        :returns: iterable of PhysicalVolume instances
        """

        for volume in pvs(pathspec):
            yield cls(volume)
示例#2
0
    def search(cls, pathspec=None):
        """Search for volumes matching ``pathspec``

        This will search for any physical volumes matching ``pathspec`` and
        return an iterable that provides instance of PhysicalVolume

        :returns: iterable of PhysicalVolume instances
        """

        for volume in pvs(pathspec):
            yield cls(volume)
示例#3
0
文件: base.py 项目: bmildren/holland
    def lookup(cls, pathspec):
        """Lookup a physical volume for the pathspec given

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

        :returns: PhysicalVolume instance
        """
        try:
            volume, = pvs(pathspec)
            return cls(volume)
        except (ValueError, LVMCommandError):
            raise LookupError("No PhysicalVolume could be found for "
                              "pathspec %r" % pathspec)
示例#4
0
    def lookup(cls, pathspec):
        """Lookup a physical volume for the pathspec given

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

        :returns: PhysicalVolume instance
        """
        try:
            volume, = pvs(pathspec)
            return cls(volume)
        except (ValueError, LVMCommandError):
            raise LookupError("No PhysicalVolume could be found for "
                              "pathspec %r" %
                              pathspec)
示例#5
0
文件: base.py 项目: bmildren/holland
 def reload(self):
     """Reload this PhysicalVolume"""
     self.attributes, = pvs(self.pv_name)
示例#6
0
 def reload(self):
     """Reload this PhysicalVolume"""
     self.attributes, = pvs(self.pv_name)