コード例 #1
0
 def _assess_status_func():
     state, message = _determine_os_workload_status(
         configs, {},
         charm_func=assess_cluster_status,
         services=services(), ports=None)
     if state == 'active' and clustered():
         message = 'Unit is ready and clustered'
     status_set(state, message)
コード例 #2
0
 def _assess_status_func():
     state, message = _determine_os_workload_status(
         configs, {},
         charm_func=assess_cluster_status,
         services=services(), ports=None)
     if state == 'active' and clustered():
         message = 'Unit is ready and clustered'
     # Remind the administrator cluster_series_upgrading is set.
     # If the cluster has completed the series upgrade, run the
     # complete-cluster-series-upgrade action to clear this setting.
     if leader_get('cluster_series_upgrading'):
         message += (", Run complete-cluster-series-upgrade when the "
                     "cluster has completed its upgrade.")
         # Edge case when the first rabbitmq unit is upgraded it will show
         # waiting for peers. Force "active" workload state for various
         # testing suites like zaza to recognize a successful series upgrade
         # of the first unit.
         if state == "waiting":
             state = "active"
     status_set(state, message)
コード例 #3
0
def assess_status(configs):
    """Assess status of current unit
    Decides what the state of the unit should be based on the current
    configuration.
    @param configs: a templating.OSConfigRenderer() object
    @returns None - this function is executed for its side-effect
    """
    state, message = _determine_os_workload_status(configs,
                                                   REQUIRED_INTERFACES.copy())
    if state != 'active':
        status_set(state, message)
    else:
        remote_hosts = config('remote-hosts')
        if remote_hosts:
            remote_hosts = remote_hosts.split()
            status_set(
                'active',
                'Unit is ready (managing: {})'.format(','.join(remote_hosts)))
        else:
            status_set('blocked', 'Missing remote-hosts configuration')
    application_version_set(config('openstack-release'))