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


Python AccountBroker.is_deleted方法代码示例

本文整理汇总了Python中swift.account.backend.AccountBroker.is_deleted方法的典型用法代码示例。如果您正苦于以下问题:Python AccountBroker.is_deleted方法的具体用法?Python AccountBroker.is_deleted怎么用?Python AccountBroker.is_deleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在swift.account.backend.AccountBroker的用法示例。


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

示例1: account_audit

# 需要导入模块: from swift.account.backend import AccountBroker [as 别名]
# 或者: from swift.account.backend.AccountBroker import is_deleted [as 别名]
    def account_audit(self, path):
        """
        Audits the given account path

        :param path: the path to an account db
        """
        start_time = time.time()
        try:
            broker = AccountBroker(path)
            if not broker.is_deleted():
                self.validate_per_policy_counts(broker)
                self.logger.increment('passes')
                self.account_passes += 1
                self.logger.debug(_('Audit passed for %s'), broker)
        except InvalidAccountInfo as e:
            self.logger.increment('failures')
            self.account_failures += 1
            self.logger.error(
                _('Audit Failed for %(path)s: %(err)s'),
                {'path': path, 'err': str(e)})
        except (Exception, Timeout):
            self.logger.increment('failures')
            self.account_failures += 1
            self.logger.exception(_('ERROR Could not get account info %s'),
                                  path)
        self.logger.timing_since('timing', start_time)
开发者ID:bebule,项目名称:swift,代码行数:28,代码来源:auditor.py

示例2: get_data

# 需要导入模块: from swift.account.backend import AccountBroker [as 别名]
# 或者: from swift.account.backend.AccountBroker import is_deleted [as 别名]
    def get_data(self, db_path):
        """
        Data for generated csv has the following columns:
        Account Hash, Container Count, Object Count, Bytes Used

        :raises sqlite3.Error: does not catch errors connecting to db
        """
        line_data = None
        broker = AccountBroker(db_path)
        if not broker.is_deleted():
            info = broker.get_info()
            line_data = '"%s",%d,%d,%d\n' % (info['account'],
                                             info['container_count'],
                                             info['object_count'],
                                             info['bytes_used'])
        return line_data
开发者ID:ClodoCorp,项目名称:slogging,代码行数:18,代码来源:db_stats_collector.py

示例3: account_audit

# 需要导入模块: from swift.account.backend import AccountBroker [as 别名]
# 或者: from swift.account.backend.AccountBroker import is_deleted [as 别名]
    def account_audit(self, path):
        """
        Audits the given account path

        :param path: the path to an account db
        """
        start_time = time.time()
        try:
            broker = AccountBroker(path)
            if not broker.is_deleted():
                broker.get_info()
                self.logger.increment('passes')
                self.account_passes += 1
                self.logger.debug(_('Audit passed for %s') % broker)
        except (Exception, Timeout):
            self.logger.increment('failures')
            self.account_failures += 1
            self.logger.exception(_('ERROR Could not get account info %s'),
                                  path)
        self.logger.timing_since('timing', start_time)
开发者ID:10389030,项目名称:swift,代码行数:22,代码来源:auditor.py

示例4: account_crawl

# 需要导入模块: from swift.account.backend import AccountBroker [as 别名]
# 或者: from swift.account.backend.AccountBroker import is_deleted [as 别名]
    def account_crawl(self, path):
        """
        Crawls the given account path

        :param path: the path to an account db
        """
        #start_time = time.time()
        metaDict = {}
        try:
            broker = AccountBroker(path)
            if not broker.is_deleted():
                #reportedTime = broker.get_info()['put_timestamp']
                #if normalize_timestamp(self.crawled_time) <
                #reportedTime < normalize_timestamp(start_time):
                metaDict = broker.get_info()
                metaDict.update((key, value)
                       for key, (value, timestamp) in
                       broker.metadata.iteritems() if value != '')
        except (Exception, Timeout):
            self.logger.increment('failures')
        return metaDict
开发者ID:ucsc-hp-group,项目名称:swift,代码行数:23,代码来源:crawler.py


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