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


Python reactive.set_state方法代码示例

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


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

示例1: render_config

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def render_config(*args):
    """Render the configuration for charm when all the interfaces are
    available.
    """
    with charm.provide_charm_instance() as charm_class:
        charm_class.render_with_interfaces(args)
        charm_class.assess_status()
    reactive.set_state('config.rendered')


# db_sync checks if sync has been done so rerunning is a noop 
开发者ID:openstack,项目名称:charm-murano,代码行数:13,代码来源:murano_handlers.py

示例2: render_config

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def render_config(*args):
    """Render the configuration for charm when all the interfaces are
    available.
    """
    with charm.provide_charm_instance() as charm_class:
        charm_class.upgrade_if_available(args)
        charm_class.enable_services()
        charm_class.render_with_interfaces(args)
        charm_class.enable_webserver_site()
        charm_class.assess_status()
    reactive.set_state('config.rendered')


# db_sync checks if sync has been done so rerunning is a noop 
开发者ID:openstack,项目名称:charm-gnocchi,代码行数:16,代码来源:gnocchi_handlers.py

示例3: render_stuff

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def render_stuff(*args):
    # Get the optional hsm relation, if it is available for rendering.
    trove.render_configs(args)
    reactive.set_state('config.complete')
    trove.assess_status() 
开发者ID:openstack,项目名称:charm-trove,代码行数:7,代码来源:trove_handlers.py

示例4: run_db_migration

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def run_db_migration():
    trove.db_sync()
    trove.restart_all()
    reactive.set_state('db.synced')
    trove.assess_status() 
开发者ID:openstack,项目名称:charm-trove,代码行数:7,代码来源:trove_handlers.py

示例5: configure_domain_name

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def configure_domain_name(domain):
    keystone_ldap.render_config(domain.trigger_restart)
    domain.domain_name(hookenv.config('domain-name') or
                       hookenv.service_name())
    reactive.set_state('domain-name-configured') 
开发者ID:openstack,项目名称:charm-keystone-ldap,代码行数:7,代码来源:keystone_ldap_handlers.py

示例6: check_configuration

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def check_configuration():
    '''Validate required configuration options at set state'''
    if keystone_ldap.configuration_complete():
        reactive.set_state('config.complete')
    else:
        reactive.remove_state('config.complete')
    keystone_ldap.assess_status() 
开发者ID:openstack,项目名称:charm-keystone-ldap,代码行数:9,代码来源:keystone_ldap_handlers.py

示例7: configure_openvswitch

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def configure_openvswitch(odl_ovsdb):
    with charm.provide_charm_instance() as ovs_odl_charm:
        ovs_odl_charm.configure_openvswitch(odl_ovsdb)
    reactive.set_state('ovs.configured') 
开发者ID:openstack,项目名称:charm-openvswitch-odl,代码行数:6,代码来源:openvswitch_odl_handlers.py

示例8: default_install

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def default_install():
    """Provide a default install handler

    The instance automagically becomes the derived OpenStackCharm instance.
    The kv() key charmers.openstack-release-version' is used to cache the
    release being used for this charm.  It is determined by the
    default_select_release() function below, unless this is overriden by
    the charm author
    """
    unitdata.kv().unset(defaults.OPENSTACK_RELEASE_KEY)
    with charm.provide_charm_instance() as instance:
        instance.install()
    reactive.set_state('charm.installed') 
开发者ID:openstack,项目名称:charm-layer-openstack,代码行数:15,代码来源:layer_openstack.py

示例9: default_upgrade_charm

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def default_upgrade_charm():
    """Default handler for the 'upgrade-charm' hook.
    This calls the charm.singleton.upgrade_charm() function as a default.
    """
    reactive.set_state('run-default-upgrade-charm') 
开发者ID:openstack,项目名称:charm-layer-openstack,代码行数:7,代码来源:layer_openstack.py

示例10: default_update_status

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def default_update_status():
    """Default handler for update-status state.
    Just call update status.
    """
    reactive.set_state('run-default-update-status') 
开发者ID:openstack,项目名称:charm-layer-openstack,代码行数:7,代码来源:layer_openstack.py

示例11: make_default_install_handler

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def make_default_install_handler():
    """Set the default charm.installed state so that the default handler in
    layer-openstack can run.
    Convoluted, because charms.reactive will only run handlers in the reactive
    or hooks directory.
    """
    reactive.set_state('charms.openstack.do-default-charm.installed') 
开发者ID:openstack,项目名称:charms.openstack,代码行数:9,代码来源:defaults.py

示例12: make_default_amqp_connection_handler

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def make_default_amqp_connection_handler():
    """Set the default amqp.connected state so that the default handler in
    layer-openstack can run.
    Convoluted, because charms.reactive will only run handlers in the reactive
    or hooks directory.
    """
    reactive.set_state('charms.openstack.do-default-amqp.connected') 
开发者ID:openstack,项目名称:charms.openstack,代码行数:9,代码来源:defaults.py

示例13: make_default_setup_database_handler

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def make_default_setup_database_handler():
    """Set the default shared-db.connected state so that the default handler in
    layer-openstack can run.
    Convoluted, because charms.reactive will only run handlers in the reactive
    or hooks directory.
    """
    reactive.set_state('charms.openstack.do-default-shared-db.connected') 
开发者ID:openstack,项目名称:charms.openstack,代码行数:9,代码来源:defaults.py

示例14: make_default_setup_endpoint_connection

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def make_default_setup_endpoint_connection():
    """Set the default identity-service.connected state so that the default
    handler in layer-openstack can run.
    Convoluted, because charms.reactive will only run handlers in the reactive
    or hooks directory.
    """
    reactive.set_state(
        'charms.openstack.do-default-identity-service.connected') 
开发者ID:openstack,项目名称:charms.openstack,代码行数:10,代码来源:defaults.py

示例15: make_setup_endpoint_available_handler

# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import set_state [as 别名]
def make_setup_endpoint_available_handler():
    """Set the default identity-service.available state so that the default
    handler in layer-openstack can run.
    Convoluted, because charms.reactive will only run handlers in the reactive
    or hooks directory.
    """
    reactive.set_state(
        'charms.openstack.do-default-identity-service.available') 
开发者ID:openstack,项目名称:charms.openstack,代码行数:10,代码来源:defaults.py


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