示例#1
0
    def create(self):
        """ Create the device. """
        if self.exists:
            raise DeviceError("device already exists", self.name)
        try:
            self.createParents()
            self.setupParents()

            # should we use --zero for safety's sake?
            lvm.lvcreate(self.vg.name, self._name, self.size)
        except Exception:
            raise
        else:
            # FIXME set / update self.uuid here
            self.exists = True
            self.setup()
示例#2
0
    def create(self, intf=None):
        """ Create the device. """
        if self.exists:
            raise LogicalVolumeError("device already exists", self.name)

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

            # should we use --zero for safety's sake?
            lvm.lvcreate(self.vg.name, self._name, self.size)
        except Exception, msg:
            raise LogicalVolumeError("Create device failed", self._name)
示例#3
0
    def create(self, intf=None):
        """ Create the device. """
        if self.exists:
            raise LogicalVolumeError("device already exists", self.name)

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

            # should we use --zero for safety's sake?
            lvm.lvcreate(self.vg.name, self._name, self.size)
        except Exception, msg:
            raise LogicalVolumeError("Create device failed", self._name)
示例#4
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()

            # should we use --zero for safety's sake?
            lvm.lvcreate(self.vg.name, self._name, self.size)
        except Exception:
            raise
        else:
            # FIXME set / update self.uuid here
            self.exists = True
            self.setup()
        finally:
            if w:
                w.pop()