Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        """ Create a Filesystem instance.

            Keyword Args:

                device -- path to the device containing the filesystem
                mountpoint -- the filesystem's mountpoint
                label -- the filesystem label
                uuid -- the filesystem UUID
                mountopts -- mount options for the filesystem
                size -- the filesystem's size in MiB
                exists -- indicates whether this is an existing filesystem

        """
        if self.__class__ is Filesystem:
            raise TypeError("Filesystem is an abstract class.")

        Format.__init__(self, *args, **kwargs)
        self.mountpoint = kwargs.get("mountpoint")
        self.mountopts = kwargs.get("mountopts")
        self.label = kwargs.get("label")
        self.fsprofile = kwargs.get("fsprofile")

        # filesystem size does not necessarily equal device size
        self._size = kwargs.get("size", 0)
        self._minInstanceSize = None    # min size of this FS instance
        self._mountpoint = None     # the current mountpoint when mounted
        if self.exists and self.supported:
            self._size = self._getExistingSize()
            foo = self.minSize      # force calculation of minimum size

        self._targetSize = self._size

        if self.supported:
            self.loadModule()
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        """ Create a Filesystem instance.

            Keyword Args:

                device -- path to the device containing the filesystem
                mountpoint -- the filesystem's mountpoint
                label -- the filesystem label
                uuid -- the filesystem UUID
                mountopts -- mount options for the filesystem
                size -- the filesystem's size in MiB
                exists -- indicates whether this is an existing filesystem

        """
        if self.__class__ is Filesystem:
            raise TypeError("Filesystem is an abstract class.")

        Format.__init__(self, *args, **kwargs)
        self.mountpoint = kwargs.get("mountpoint")
        self.mountopts = kwargs.get("mountopts")
        self.label = kwargs.get("label")
        self.fsprofile = kwargs.get("fsprofile")

        # filesystem size does not necessarily equal device size
        self._size = kwargs.get("size", 0)
        self._minInstanceSize = None    # min size of this FS instance
        self._mountpoint = None     # the current mountpoint when mounted
        if self.exists and self.supported:
            self._size = self._getExistingSize()
            foo = self.minSize      # force calculation of minimum size

        self._targetSize = self._size

        if self.supported:
            self.loadModule()
Ejemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        """ Create a RaidMember instance.

            Keyword Arguments:

                device -- path to underlying device
                uuid -- this member device's uuid
                mdUuid -- the uuid of the array this device belongs to
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)
        self.mdUuid = kwargs.get("mdUuid")
        self.raidMinor = None

        self.biosraid = kwargs.get("biosraid")
Ejemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        """ Create a RaidMember instance.

            Keyword Arguments:

                device -- path to underlying device
                uuid -- this member device's uuid
                mdUuid -- the uuid of the array this device belongs to
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)
        self.mdUuid = kwargs.get("mdUuid")
        self.raidMinor = None

        self.biosraid = kwargs.get("biosraid")
Ejemplo n.º 5
0
    def __init__(self, *args, **kwargs):
        """ Create a Format instance.

            Keyword Arguments:

                device -- path to the underlying device
                uuid -- this format's UUID
                exists -- indicates whether this is an existing format

            On initialization this format is like Format

        """
        Format.__init__(self, *args, **kwargs)

        # Initialize the attribute that will hold the block object.
        self._raidmem = None
Ejemplo n.º 6
0
    def __init__(self, *args, **kwargs):
        """ Create a Format instance.

            Keyword Arguments:

                device -- path to the underlying device
                uuid -- this format's UUID
                exists -- indicates whether this is an existing format

            On initialization this format is like Format

        """
        Format.__init__(self, *args, **kwargs)

        # Initialize the attribute that will hold the block object.
        self._raidmem = None
Ejemplo n.º 7
0
    def __init__(self, *args, **kwargs):
        """ Create a SwapSpace instance.

            Keyword Arguments:

                device -- path to the underlying device
                uuid -- this swap space's uuid
                label -- this swap space's label
                priority -- this swap space's priority
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)

        self.priority = kwargs.get("priority")
        self.label = kwargs.get("label")
Ejemplo n.º 8
0
    def __init__(self, *args, **kwargs):
        """ Create a SwapSpace instance.

            Keyword Arguments:

                device -- path to the underlying device
                uuid -- this swap space's uuid
                label -- this swap space's label
                priority -- this swap space's priority
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)

        self.priority = kwargs.get("priority")
        self.label = kwargs.get("label")
Ejemplo n.º 9
0
    def __init__(self, *args, **kwargs):
        """ Create an PhysicalVolume instance.

            Keyword Arguments:

                device -- path to the underlying device
                uuid -- this PV's uuid (not the VG uuid)
                vgName -- the name of the VG this PV belongs to
                vgUuid -- the UUID of the VG this PV belongs to
                peStart -- offset of first physical extent
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)
        self.vgName = kwargs.get("vgName")
        self.vgUuid = kwargs.get("vgUuid")
        self.peStart = kwargs.get("peStart", 0.1875)    # in MB
Ejemplo n.º 10
0
    def __init__(self, *args, **kwargs):
        """ Create an PhysicalVolume instance.

            Keyword Arguments:

                device -- path to the underlying device
                uuid -- this PV's uuid (not the VG uuid)
                vgName -- the name of the VG this PV belongs to
                vgUuid -- the UUID of the VG this PV belongs to
                peStart -- offset of first physical extent
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)
        self.vgName = kwargs.get("vgName")
        self.vgUuid = kwargs.get("vgUuid")
        self.peStart = kwargs.get("peStart", 0.1875)    # in MB
Ejemplo n.º 11
0
    def __init__(self, *args, **kwargs):
        """ Create a DiskLabel instance.

            Keyword Arguments:

                device -- path to the underlying device
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)

        self._size = None

        self._partedDevice = None
        self._partedDisk = None
        self._origPartedDisk = None
        self._alignment = None
        self._endAlignment = None

        if self.partedDevice:
            # set up the parted objects and raise exception on failure
            self._origPartedDisk = self.partedDisk.duplicate()
Ejemplo n.º 12
0
    def __init__(self, *args, **kwargs):
        """ Create a DiskLabel instance.

            Keyword Arguments:

                device -- path to the underlying device
                exists -- indicates whether this is an existing format

        """
        Format.__init__(self, *args, **kwargs)

        self._size = None

        self._partedDevice = None
        self._partedDisk = None
        self._origPartedDisk = None
        self._alignment = None
        self._endAlignment = None

        if self.partedDevice:
            # set up the parted objects and raise exception on failure
            self._origPartedDisk = self.partedDisk.duplicate()