本文整理汇总了Python中charms.reactive.remove_state方法的典型用法代码示例。如果您正苦于以下问题:Python reactive.remove_state方法的具体用法?Python reactive.remove_state怎么用?Python reactive.remove_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charms.reactive
的用法示例。
在下文中一共展示了reactive.remove_state方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clear_domain_name_configured
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def clear_domain_name_configured(*args):
reactive.remove_state('domain-name-configured')
示例2: check_configuration
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_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()
示例3: unconfigure_openvswitch
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def unconfigure_openvswitch(odl_ovsdb=None):
with charm.provide_charm_instance() as ovs_odl_charm:
ovs_odl_charm.unconfigure_openvswitch(odl_ovsdb)
reactive.remove_state('ovs.configured')
示例4: run_default_upgrade_charm
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def run_default_upgrade_charm():
with charm.provide_charm_instance() as instance:
instance.upgrade_charm()
reactive.remove_state('run-default-upgrade-charm')
示例5: run_default_update_status
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def run_default_update_status():
with charm.provide_charm_instance() as instance:
instance.assess_status()
reactive.remove_state('run-default-update-status')
示例6: check_dns_slaves
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def check_dns_slaves():
"""verify if the config('dns-slaves') is valid and set or remove the state
accordingly. Note, that hooks run BEFORE the reactive handlers so this
should happen first during a hook.
"""
if hookenv.config('dns-slaves'):
with provide_charm_instance() as instance:
if not instance.options.invalid_pool_config():
reactive.set_state('dns-slaves-config-valid')
return
reactive.remove_state('dns-slaves-config-valid')
示例7: clear_dns_config_available
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def clear_dns_config_available():
reactive.remove_state(DNS_CONFIG_AVAILABLE)
示例8: install_packages
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def install_packages():
"""Install charms packages"""
with provide_charm_instance() as instance:
instance.install()
reactive.set_state('installed')
reactive.remove_state('amqp.requested-access')
reactive.remove_state('shared-db.setup')
reactive.remove_state('base-config.rendered')
reactive.remove_state('db.synched')
示例9: retrieve_zones
# 需要导入模块: from charms import reactive [as 别名]
# 或者: from charms.reactive import remove_state [as 别名]
def retrieve_zones(self, cluster_relation=None):
"""Retrieve and install zones file
Check if published sync target was created after this units sync
request was sent, if it was install the zones file. Alternatively if
no peer relation was set then assume the current sync target is to be
used regardless of when it was created.
:param cluster_relation: OpenstackHAPeers() interface class
:returns: None
"""
request_time = None
if cluster_relation:
request_times = list(set(
cluster_relation.retrieve_local(CLUSTER_SYNC_KEY)))
request_time = request_times[0]
sync_time = DesignateBindCharm.get_sync_time()
if request_time and request_time > sync_time:
hookenv.log(('Request for sync sent but remote sync time is too'
' old, defering until a more up-to-date target is '
'available'),
level=hookenv.WARNING)
else:
self.service_control('stop', ['bind9'])
url = DesignateBindCharm.get_sync_src()
self.wget_file(url, ZONE_DIR)
tar_file = url.split('/')[-1]
subprocess.check_call(['tar', 'xf', tar_file], cwd=ZONE_DIR)
os.remove('{}/{}'.format(ZONE_DIR, tar_file))
self.service_control('start', ['bind9'])
reactive.remove_state('sync.request.sent')
reactive.set_state('zones.initialised')