Example #1
0
    def create(self, intf=None):
        """ Create the device. """
        if self.exists:
            raise VolumeGroupError("device already exists", self.name)

        w = None
        if intf:
            w = intf.progressWindow(_("Creating device %s") % (self.path,))

        try:
            self.createParents()
            self.setupParents()

            pv_list = [pv.path for pv in self.parents]
            lvm.vgcreate(self.name, pv_list, self.peSize)
        except Exception, msg:
            raise VolumeGroupError, msg
Example #2
0
    def create(self, intf=None):
        """ Create the device. """
        if self.exists:
            raise VolumeGroupError("device already exists", self.name)

        w = None
        if intf:
            w = intf.progressWindow(_("Creating device %s") % (self.path, ))

        try:
            self.createParents()
            self.setupParents()

            pv_list = [pv.path for pv in self.parents]
            lvm.vgcreate(self.name, pv_list, self.peSize)
        except Exception, msg:
            raise VolumeGroupError, msg
Example #3
0
    def create(self, intf=None):
        """ Create the device. """
        if self.exists:
            raise DeviceError("device already exists", self.name)

        w = None
        if intf:
            w = intf.progressWindow(("Creating device %s") % (self.path,))

        try:
            self.createParents()
            self.setupParents()

            pv_list = [pv.path for pv in self.parents]
            lvm.vgcreate(self.name, pv_list, self.peSize)
        except Exception:
            raise
        else:
            # FIXME set / update self.uuid here
            self.exists = True
            self.setup()
        finally:
            if w:
                w.pop()