コード例 #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
ファイル: base.py プロジェクト: AlexLSB/zendesk_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)
コード例 #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
ファイル: base.py プロジェクト: AlexLSB/zendesk_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)
コード例 #5
0
ファイル: base.py プロジェクト: bmildren/holland
 def reload(self):
     """Reload this PhysicalVolume"""
     self.attributes, = pvs(self.pv_name)
コード例 #6
0
ファイル: base.py プロジェクト: AlexLSB/zendesk_holland
 def reload(self):
     """Reload this PhysicalVolume"""
     self.attributes, = pvs(self.pv_name)