本文整理匯總了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')