當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。