コード例 #1
0
def main(argv):
    cli_utils.setup_logging()
    parser = argparse.ArgumentParser()
    parser.add_argument("--service")
    parser.add_argument("--resource")
    options = parser.parse_args()
    service = cli_utils.parse_arg(options, 'service')
    resource = cli_utils.parse_arg(options, 'resource')
    xenial = distro_info.UbuntuDistroInfo().all.index('xenial')
    series = os.environ.get('MOJO_SERIES')
    mojo_env = distro_info.UbuntuDistroInfo().all.index(series)
    if mojo_env >= xenial:
        resource = resource.replace('eth0', 'ens2')
    mojo_os_utils.delete_crm_leader(service, resource)
コード例 #2
0
def main(argv):
    cli_utils.setup_logging()
    parser = argparse.ArgumentParser()
    parser.add_argument("term_method", default='juju', nargs='?')
    options = parser.parse_args()
    term_method = cli_utils.parse_arg(options, 'term_method')
    services = mojo_utils.get_principle_applications()
    for svc in services:
        doomed_service = services.pop(0)
        if mojo_utils.is_crm_clustered(doomed_service):
            mojo_os_utils.delete_crm_leader(doomed_service, method=term_method)
        else:
            mojo_utils.delete_oldest(doomed_service, method=term_method)
        mojo_utils.juju_check_hooks_complete()
        mojo_utils.juju_wait_finished()
        mojo_utils.add_unit(svc, unit_num=1)
        mojo_utils.juju_check_hooks_complete()
        mojo_utils.juju_wait_finished()
コード例 #3
0
def main(argv):
    logging.basicConfig(level=logging.INFO)
    parser = argparse.ArgumentParser()
    parser.add_argument("term_method", default='juju', nargs='?')
    options = parser.parse_args()
    term_method = mojo_utils.parse_mojo_arg(options, 'term_method')
    services = mojo_utils.get_principle_services()
    for svc in services:
        doomed_service = services.pop(0)
        if mojo_utils.is_crm_clustered(doomed_service):
            mojo_os_utils.delete_crm_leader(doomed_service, method=term_method)
        else:
            mojo_utils.delete_oldest(doomed_service, method=term_method)
        mojo_utils.juju_check_hooks_complete()
        mojo_utils.juju_status_check_and_wait()
        mojo_utils.add_unit(svc, unit_num=1)
        mojo_utils.juju_check_hooks_complete()
        mojo_utils.juju_status_check_and_wait()