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


Python Organization.iter_orgs方法代码示例

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


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

示例1: _upgrade_data

# 需要导入模块: from organization import Organization [as 别名]
# 或者: from organization.Organization import iter_orgs [as 别名]
    def _upgrade_data(self):
        version = self._get_version()
        cur_version = self._get_data_version()

        if cur_version and cur_version < self._get_version_int('0.10.5'):
            logger.info('Upgrading data to v0.10.5...')
            from server import Server
            for server in Server.iter_servers():
                server._upgrade_0_10_5()

            from organization import Organization
            for org in Organization.iter_orgs():
                org._upgrade_0_10_5()

        if cur_version and cur_version < self._get_version_int('0.10.6'):
            logger.info('Upgrading data to v0.10.6...')
            if self.password:
                from cache import persist_db
                logger.info('Upgrading config to v0.10.6...')
                salt = base64.b64encode(
                    '2511cebca93d028393735637bbc8029207731fcf')
                password = base64.b64encode(self.password.decode('hex'))
                persist_db.dict_set('auth', 'password',
                    '0$%s$%s' % (salt, password))
                self.password = None
                self.commit()

            from server import Server
            for server in Server.iter_servers():
                server._upgrade_0_10_6()

        if cur_version and cur_version < self._get_version_int('0.10.9'):
            logger.info('Upgrading data to v0.10.9...')
            from server import Server
            for server in Server.iter_servers():
                server._upgrade_0_10_9()

            from organization import Organization
            for org in Organization.iter_orgs():
                for user in org.iter_users():
                    user._upgrade_0_10_9()
                org.sort_users_cache()

        if cur_version != version:
            from pritunl import __version__
            version_path = os.path.join(self.data_path, VERSION_NAME)
            with open(version_path, 'w') as version_file:
                version_file.write('%s\n' % __version__)
开发者ID:WrongChao,项目名称:pritunl,代码行数:50,代码来源:app_server.py

示例2: _fill_cache

# 需要导入模块: from organization import Organization [as 别名]
# 或者: from organization.Organization import iter_orgs [as 别名]
    def _fill_cache(self):
        logger.info('Preloading cache...')
        from organization import Organization
        for org in Organization.iter_orgs():
            org._cache_users()

        from server import Server
        for server in Server.iter_servers():
            server.load()
开发者ID:WrongChao,项目名称:pritunl,代码行数:11,代码来源:app_server.py

示例3: _fill_users_pool

# 需要导入模块: from organization import Organization [as 别名]
# 或者: from organization.Organization import iter_orgs [as 别名]
 def _fill_users_pool(self):
     end = True
     for org in itertools.chain(Organization.iter_orgs(),
             Organization.iter_orgs_pool()):
         if not cache_db.set_length('openssl_tasks') and \
                 app_server.user_pool_size - org.client_pool_count > 0:
             end = False
             org.new_user(type=CERT_CLIENT_POOL)
         if not cache_db.set_length('openssl_tasks') and \
                 app_server.server_user_pool_size - \
                 org.server_pool_size > 0:
             end = False
             org.new_user(type=CERT_SERVER_POOL)
     if not end:
         self._fill_users_pool()
开发者ID:bitland,项目名称:pritunl,代码行数:17,代码来源:pooler.py


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