• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mdl_updater.model_updater函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: auth_del

 def auth_del(self, **kwargs):
     """
     Remove Authorised keyring
     """
     self.model.kargs_apply(**kwargs)
     u = mdl_updater.model_updater(m)
     u.hostname_refresh()
     if m.cluster_name == None:
         u.defaults_refresh()
     self.cluster_name = m.cluster_name
     u.load_confg(m.cluster_name)
     u.mon_members_refresh()
     q = mdl_query.mdl_query(m)
     if not q.mon_is():
         raise Error("Not ruining a mon daemon")
     u.mon_status()
     if not q.mon_quorum():
         raise Error("mon daemon is not in quorum")
     arguments = [
             "ceph",
             "auth",
             "del",
             self.keyring_name
             ]
     cmd_out = utils.execute_local_command(arguments)
     return True
开发者ID:theanalyst,项目名称:sesceph,代码行数:26,代码来源:keyring.py


示例2: update_model

def update_model(mdl):
    # Utility function to update model for osd_ctrl
    u = mdl_updater.model_updater(mdl)
    u.symlinks_refresh()
    u.defaults_refresh()
    u.partitions_all_refresh()
    u.discover_partitions_refresh()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:7,代码来源:osd.py


示例3: auth_add

 def auth_add(self, **kwargs):
     """
     Authorise keyring
     """
     self.model.kargs_apply(**kwargs)
     u = mdl_updater.model_updater(self.model)
     u.hostname_refresh()
     if self.model.cluster_name == None:
         u.defaults_refresh()
     keyring_path = self.get_path_keyring()
     if not os.path.isfile(keyring_path):
         raise Error("rgw keyring not found")
     u.load_confg(self.model.cluster_name)
     u.mon_members_refresh()
     q = mdl_query.mdl_query(self.model)
     if not q.mon_is():
         raise Error("Not ruining a mon daemon")
     u.mon_status()
     if not q.mon_quorum():
         raise Error("mon daemon is not in quorum")
     arguments = [
             "ceph",
             "auth",
             "import",
             "-i",
             keyring_path
             ]
     cmd_out = utils.execute_local_command(arguments)
     return True
开发者ID:theanalyst,项目名称:sesceph,代码行数:29,代码来源:keyring.py


示例4: __init__

 def __init__(self, **kwargs):
     self.model = model.model(**kwargs)
     self._clear_implementation()
     u = mdl_updater.model_updater(self.model)
     u.ceph_version_refresh()
     q = mdl_query.mdl_query(self.model)
     self.ceph_daemon_user = q.ceph_daemon_user()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:7,代码来源:mon.py


示例5: status

    def status(self, **kwargs):
        """
        Get status from mon deamon

        CLI Example:

            salt '*' sesceph.prepare
                    'cluster_name'='ceph' \
                    'cluster_uuid'='cluster_uuid' \
        Notes:

        cluster_uuid
            Set the cluster UUID. Defaults to value found in ceph config file.

        cluster_name
            Set the cluster name. Defaults to "ceph".
        """

        hostname = platform.node()
        u = mdl_updater.model_updater(self.model)
        u.hostname_refresh()
        try:
            u.defaults_refresh()
        except:
            return {}
        u.load_confg(self.model.cluster_name)
        u.mon_members_refresh()
        q = mdl_query.mdl_query(self.model)
        if not q.mon_is():
            raise Error("Not a mon node")
        u.mon_status()
        p = presenter.mdl_presentor(self.model)
        return p.mon_status()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:33,代码来源:mon.py


示例6: quorum

    def quorum(self, **kwargs):
        """
        Is mon deamon in quorum

        CLI Example:

            salt '*' sesceph.prepare
                    'cluster_name'='ceph' \
                    'cluster_uuid'='cluster_uuid' \
        Notes:

        cluster_uuid
            Set the cluster UUID. Defaults to value found in ceph config file.

        cluster_name
            Set the cluster name. Defaults to "ceph".
        """

        hostname = platform.node()
        u = mdl_updater.model_updater(self.model)
        u.hostname_refresh()
        try:
            u.defaults_refresh()
        except:
            raise Error("Could not get cluster details")
        u.load_confg(self.model.cluster_name)
        u.mon_members_refresh()
        u.mon_status()
        q = mdl_query.mdl_query(self.model)
        return q.mon_quorum()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:30,代码来源:mon.py


示例7: cluster_status

def cluster_status(**kwargs):
    """
    Get the cluster status

    CLI Example:

        salt '*' sesceph.cluster_status \\
                'cluster_name'='ceph' \\
                'cluster_uuid'='cluster_uuid'
    Notes:
    Get the cluster status including health if in quorum.

    Scope:
    Cluster wide

    Arguments:

    cluster_uuid
        Set the cluster UUID. Defaults to value found in ceph config file.

    cluster_name
        Set the cluster name. Defaults to "ceph".
    """
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    u.defaults_refresh()
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    mur = mdl_updater_remote.model_updater_remote(m)
    can_connect = mur.connect()
    if not can_connect:
        raise Error("Cant connect to cluster.")
    p = presenter.mdl_presentor(m)
    return p.cluster_status()
开发者ID:hoonetorg,项目名称:python-ceph-cfg,代码行数:35,代码来源:__init__.py


示例8: keyring_auth_list

def keyring_auth_list(**kwargs):
    """
    List all cephx authorization keys

    CLI Example:

        salt '*' sesceph.auth_list \\
                'cluster_name'='ceph' \\
                'cluster_uuid'='cluster_uuid'
    Notes:

    cluster_name
        Set the cluster name. Defaults to "ceph".

    cluster_uuid
        Set the cluster UUID. Defaults to value found in ceph config file.
    """
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    try:
        u.defaults_refresh()
    except:
        return {}
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    u.auth_list()
    p = presenter.mdl_presentor(m)
    return p.auth_list()
开发者ID:LenzGr,项目名称:sesceph,代码行数:29,代码来源:__init__.py


示例9: pool_del

def pool_del(pool_name, **kwargs):
    """
    List all cephx authorization keys

    CLI Example:

        salt '*' sesceph.pool_del pool_name \\
                'cluster_name'='ceph' \\
                'cluster_uuid'='cluster_uuid'
    Notes:

    cluster_name
        Set the cluster name. Defaults to "ceph".

    cluster_uuid
        Set the cluster UUID. Defaults to value found in ceph config file.
    """
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    u.defaults_refresh()
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    mur = mdl_updater_remote.model_updater_remote(m)
    can_connect = mur.connect()
    if not can_connect:
        raise Error("Cant connect to cluster.")
    mur.pool_list()
    return mur.pool_del(pool_name)
开发者ID:hoonetorg,项目名称:python-ceph-cfg,代码行数:29,代码来源:__init__.py


示例10: cluster_quorum

def cluster_quorum(**kwargs):
    """
    Get the cluster status

    CLI Example:

        salt '*' sesceph.cluster_status \\
                'cluster_name'='ceph' \\
                'cluster_uuid'='cluster_uuid'
    Notes:
    Get the cluster quorum status.

    Scope:
    Cluster wide

    Arguments:

    cluster_uuid
        Set the cluster UUID. Defaults to value found in ceph config file.

    cluster_name
        Set the cluster name. Defaults to "ceph".
    """
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    u.defaults_refresh()
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    mur = mdl_updater_remote.model_updater_remote(m)
    can_connect = mur.connect()
    if not can_connect:
        return False
    q = mdl_query.mdl_query(m)
    return q.cluster_quorum()
开发者ID:hoonetorg,项目名称:python-ceph-cfg,代码行数:35,代码来源:__init__.py


示例11: mon_is

    def mon_is(self, **kwargs):
        """
        Is this a mon node

        CLI Example:

            salt '*' sesceph.keys_create
                    'cluster_name'='ceph' \
                    'cluster_uuid'='cluster_uuid' \
        Notes:

        cluster_name
            Set the cluster name. Defaults to "ceph".

        cluster_uuid
            Set the cluster UUID. Defaults to value found in ceph config file.
        """
        u = mdl_updater.model_updater(self.model)
        u.hostname_refresh()
        try:
            u.defaults_refresh()
        except:
            return False
        u.load_confg(self.model.cluster_name)
        u.mon_members_refresh()
        q = mdl_query.mdl_query(self.model)
        return q.mon_is()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:27,代码来源:mon.py


示例12: update

 def update(self):
     self.updater = mdl_updater.model_updater(self.model)
     self.updater.hostname_refresh()
     try:
         self.updater.defaults_refresh()
     except utils.Error, e:
         log.error(e)
开发者ID:hoonetorg,项目名称:python-ceph-cfg,代码行数:7,代码来源:rados_client.py


示例13: keyring_present_type

def keyring_present_type(**kwargs):
    """
    Check if keyring exists on disk

    CLI Example:

        salt '*' sesceph.keyring_admin_save \\
                '[mon.]\n\tkey = AQA/vZ9WyDwsKRAAxQ6wjGJH6WV8fDJeyzxHrg==\n\tcaps mon = \"allow *\"\n' \\
                'cluster_name'='ceph' \\
                'cluster_uuid'='cluster_uuid'
    Notes:

    cluster_uuid
        Set the cluster UUID. Defaults to value found in ceph config file.

    cluster_name
        Set the cluster name. Defaults to "ceph".
    keyring_type
        Set the keyring type
    """
    keyring_type = kwargs.get("keyring_type")
    if (keyring_type is None):
        raise Error("keyring_type is None")
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    try:
        u.defaults_refresh()
    except:
        pass
    keyobj = keyring.keyring_facard(m)
    keyobj.key_type = keyring_type
    return keyobj.present()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:33,代码来源:keyring_use.py


示例14: pool_del

def pool_del(pool_name, **kwargs):
    """
    List all cephx authorization keys

    CLI Example:

        salt '*' sesceph.pool_del pool_name \
                'cluster_name'='ceph' \
                'cluster_uuid'='cluster_uuid' \
    Notes:

    cluster_name
        Set the cluster name. Defaults to "ceph".

    cluster_uuid
        Set the cluster UUID. Defaults to value found in ceph config file.
    """
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    try:
        u.defaults_refresh()
    except:
        return {}
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    u.pool_list()
    u.pool_del(pool_name)
    return True
开发者ID:theanalyst,项目名称:sesceph,代码行数:29,代码来源:__init__.py


示例15: active

 def active(self, **kwargs):
     """
     Is mon deamon running
     """
     u = mdl_updater.model_updater(self.model)
     u.hostname_refresh()
     q = mdl_query.mdl_query(self.model)
     return q.mon_active()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:8,代码来源:mon.py


示例16: ceph_version

def ceph_version():
    """
    Get the version of ceph installed
    """
    m = model.model()
    u = mdl_updater.model_updater(m)
    u.ceph_version_refresh()
    p = presenter.mdl_presentor(m)
    return p.ceph_version()
开发者ID:theanalyst,项目名称:sesceph,代码行数:9,代码来源:__init__.py


示例17: _create_check_responding

 def _create_check_responding(self):
     """
     Check the mon service is runnign and responding.
     """
     q = mdl_query.mdl_query(self.model)
     if not q.mon_active():
         raise Error("mon service has died.")
     u = mdl_updater.model_updater(self.model)
     try:
         u.mon_status()
     except mdl_updater.Error:
         return False
     return True
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:13,代码来源:mon.py


示例18: keyring_purge_type

def keyring_purge_type(**kwargs):
    keyring_type = kwargs.get("keyring_type", None)
    if (keyring_type is None):
        raise Error("keyring_type is not set")
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    u.defaults_refresh()
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    keyobj = keyring.keyring_facard(m)
    keyobj.key_type = keyring_type
    return keyobj.remove()
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:13,代码来源:keyring_use.py


示例19: keyring_create_type

def keyring_create_type(**kwargs):
    keyring_type = kwargs.get("keyring_type")
    if (keyring_type is None):
        raise Error("keyring_type is None")
    secret = kwargs.get("secret")
    m = model.model(**kwargs)
    u = mdl_updater.model_updater(m)
    u.hostname_refresh()
    u.defaults_refresh()
    u.load_confg(m.cluster_name)
    u.mon_members_refresh()
    keyobj = keyring.keyring_facard(m)
    keyobj.key_type = keyring_type
    return keyobj.create(secret=secret)
开发者ID:AvengerMoJo,项目名称:python-ceph-cfg,代码行数:14,代码来源:keyring_use.py


示例20: write

 def write(self, key_content, **kwargs):
     """
     Persist keyring
     """
     self.model.kargs_apply(**kwargs)
     u = mdl_updater.model_updater(self.model)
     u.hostname_refresh()
     if self.model.cluster_name == None:
         u.defaults_refresh()
     keyring_path = self.get_path_keyring()
     if os.path.isfile(keyring_path):
         return True
     _keying_write(keyring_path, key_content)
     return True
开发者ID:theanalyst,项目名称:sesceph,代码行数:14,代码来源:keyring.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mdlaccesscontrol.clsAccessControl函数代码示例发布时间:2022-05-27
下一篇:
Python mdl.parseFile函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap