当前位置: 首页>>代码示例>>Python>>正文


Python anaconda_log.log_method_call函数代码示例

本文整理汇总了Python中pyanaconda.anaconda_log.log_method_call函数的典型用法代码示例。如果您正苦于以下问题:Python log_method_call函数的具体用法?Python log_method_call怎么用?Python log_method_call使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log_method_call函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create

    def create(self, *args, **kwargs):
        """ Create the format. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        intf = kwargs.get("intf")
        w = None
        if intf:
            w = intf.progressWindow(_("Formatting"),
                                    _("Creating %(type)s on %(device)s")
                                    % {"type": self.type, "device": self.device},
                                    100, pulse = True)

        try:
            DeviceFormat.create(self, *args, **kwargs)
            # Consider use of -Z|--zero
            # -f|--force or -y|--yes may be required

            # lvm has issues with persistence of metadata, so here comes the
            # hammer...
            DeviceFormat.destroy(self, *args, **kwargs)

            lvm.pvcreate(self.device, progress=w)
        except Exception:
            raise
        else:
            self.exists = True
            self.notifyKernel()
        finally:
            if w:
                w.pop()
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:30,代码来源:lvmpv.py

示例2: create

    def create(self, *args, **kwargs):
        """ Create the device. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        intf = kwargs.get("intf")
        force = kwargs.get("force")
        if not force and self.exists:
            raise SwapSpaceError("format already exists")

        if force:
            self.teardown()
        elif self.status:
            raise SwapSpaceError("device exists and is active")

        w = None
        if intf:
            w = intf.progressWindow(_("Formatting"),
                                    _("Creating %(type)s on %(device)s")
                                    % {"type": self.type, "device": kwargs.get("device", self.device)},
                                    100, pulse = True)

        try:
            DeviceFormat.create(self, *args, **kwargs)
            swap.mkswap(self.device, label=self.label, progress=w)
        except Exception:
            raise
        else:
            self.exists = True
            self.notifyKernel()
        finally:
            if w:
                w.pop()
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:32,代码来源:swap.py

示例3: create

    def create(self, *args, **kwargs):
        """ Create the format. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.hasKey:
            raise LUKSError("luks device has no key/passphrase")

        intf = kwargs.get("intf")
        w = None
        if intf:
            w = intf.waitWindow(_("Formatting"),
                                _("Encrypting %s") % kwargs.get("device",
                                                                self.device))

        try:
            DeviceFormat.create(self, *args, **kwargs)
            crypto.luks_format(self.device,
                             passphrase=self.__passphrase,
                             key_file=self._key_file,
                             cipher=self.cipher,
                             key_size=self.key_size)
        except Exception:
            raise
        else:
            self.uuid = crypto.luks_uuid(self.device)
            self.exists = True
            self.mapName = "luks-%s" % self.uuid
            self.notifyKernel()
        finally:
            if w:
                w.pop()
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:31,代码来源:luks.py

示例4: commitToDisk

 def commitToDisk(self):
     """ Commit the current partition table to disk. """
     log_method_call(self, device=self.device,
                     numparts=len(self.partitions))
     try:
         self.partedDisk.commitToDevice()
     except parted.DiskException as msg:
         raise DiskLabelCommitError(msg)
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:8,代码来源:disklabel.py

示例5: teardown

    def teardown(self, *args, **kwargs):
        """ Close, or tear down, a device. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.exists:
            raise SwapSpaceError("format has not been created")

        if self.status:
            swap.swapoff(self.device)
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:9,代码来源:swap.py

示例6: setup

    def setup(self, *args, **kwargs):
        log_method_call(self, type=self.mountType, device=self.device,
                        mountpoint=self.mountpoint)
        if not self.mountpoint and "mountpoint" not in kwargs:
            # Since btrfs vols have subvols the format setup is automatic.
            # Don't try to mount it if there's no mountpoint.
            return

        return self.mount(*args, **kwargs)
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:9,代码来源:fs.py

示例7: create

    def create(self, *args, **kwargs):
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        # allow late specification of device path
        device = kwargs.get("device")
        if device:
            self.device = device

        if not os.path.exists(self.device):
            raise FormatCreateError("invalid device specification", self.device)
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:10,代码来源:__init__.py

示例8: teardown

    def teardown(self, *args, **kwargs):
        """ Close, or tear down, the format. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.exists:
            raise LUKSError("format has not been created")

        if self.status:
            log.debug("unmapping %s" % self.mapName)
            crypto.luks_close(self.mapName)
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:10,代码来源:luks.py

示例9: commit

 def commit(self):
     """ Commit the current partition table to disk and notify the OS. """
     log_method_call(self, device=self.device,
                     numparts=len(self.partitions))
     try:
         self.partedDisk.commit()
     except parted.DiskException as msg:
         raise DiskLabelCommitError(msg)
     else:
         udev_settle()
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:10,代码来源:disklabel.py

示例10: setup

    def setup(self, *args, **kwargs):
        """ Open, or set up, a device. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.exists:
            raise DeviceFormatError("format has not been created")

        if self.status:
            return

        DeviceFormat.setup(self, *args, **kwargs)
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:11,代码来源:disklabel.py

示例11: removePassphrase

    def removePassphrase(self, passphrase):
        """ Remove the specified passphrase from the LUKS header. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.exists:
            raise LUKSError("format has not been created")

        crypto.luks_remove_key(self.device,
                             passphrase=self.__passphrase,
                             key_file=self._key_file,
                             del_passphrase=passphrase)
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:11,代码来源:luks.py

示例12: destroy

    def destroy(self, *args, **kwargs):
        """ Wipe the disklabel from the device. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.exists:
            raise DeviceFormatError("format does not exist")

        if not os.access(self.device, os.W_OK):
            raise DeviceFormatError("device path does not exist")

        self.partedDevice.clobber()
        self.exists = False
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:12,代码来源:disklabel.py

示例13: probe

    def probe(self):
        """ Probe for any missing information about this format. """
        log_method_call(self, device=self.device,
                        type=self.type, status=self.status)
        if not self.exists:
            raise MDMemberError("format does not exist")

        info = mdraid.mdexamine(self.device)
        if self.uuid is None:
            self.uuid = info['uuid']
        if self.raidMinor is None:
            self.raidMinor = info['mdMinor']
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:12,代码来源:mdraid.py

示例14: notifyKernel

    def notifyKernel(self):
        log_method_call(self, device=self.device,
                        type=self.type)
        if not self.device:
            return

        if self.device.startswith("/dev/mapper/"):
            try:
                name = dm_node_from_name(os.path.basename(self.device))
            except Exception, e:
                log.warning("failed to get dm node for %s" % self.device)
                return
开发者ID:masami256,项目名称:Anaconda-for-ore-ore-kernel,代码行数:12,代码来源:__init__.py

示例15: setup

    def setup(self, *args, **kwargs):
        """ Open, or set up, the format. """
        log_method_call(self, device=self.device, mapName=self.mapName,
                        type=self.type, status=self.status)
        if not self.configured:
            raise LUKSError("luks device not configured")

        if self.status:
            return

        DeviceFormat.setup(self, *args, **kwargs)
        crypto.luks_open(self.device, self.mapName,
                       passphrase=self.__passphrase,
                       key_file=self._key_file)
开发者ID:mattias-ohlsson,项目名称:anaconda,代码行数:14,代码来源:luks.py


注:本文中的pyanaconda.anaconda_log.log_method_call函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。