Пример #1
0
def osci_install():
    args = get_args_or_die(
        parse_osci_install_args,
        issues_for_osci_install_args)

    env = OSCIInstallEnv(
        args.osci_repo, args.osci_branch, args.swift_api_key, args.image_name,
        args.vote)

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(args.gerrit_key, 'gerrit.key')
        connection.put(
            data.install_script('osci_rewrite_config.sh'),
            'osci_rewrite_config.sh'
        )
        connection.put(
            data.install_script('osci_installscript.sh'),
            'osci_installscript.sh'
        )
        connection.put(
            data.install_script('functions.sh'),
            'functions.sh'
        )
        connection.run(
            '%s bash osci_installscript.sh' % env.bashline
        )
        connection.run(
            'rm -f gerrit.key osci_installscript.sh osci_rewrite_config.sh'
            ' functions.sh')
Пример #2
0
def nodepool_update():
    args = get_args_or_die(parse_update_args, issues_for_update_args)

    env = NodepoolInstallEnv(args.nodepool_repo, args.nodepool_branch)

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(data.install_script('update.sh'), 'update.sh')
        connection.put(data.install_script('functions.sh'), 'functions.sh')
        connection.run('%s bash update.sh' % env.bashline)
        connection.run('rm -f update.sh functions.sh')
Пример #3
0
def nodepool_configure():
    args = get_args_or_die(
        _parse_nodepool_configure_args,
        _issues_for_nodepool_configure_args
    )

    env = NodepoolConfigEnv(
        get_params_or_die(args.openrc),
        args.image_name,
        args.min_ready,
        args.rackspace_password,
        args.key_name,
        iad_max=args.iad_max,
        ord_max=args.ord_max,
        dfw_max=args.dfw_max
    )
    env.project_config_branch = args.project_config_branch
    nodepool_config_file = data.nodepool_config(env.as_dict())

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(
            data.install_script('nodepool_rewrite_config.sh'),
            'nodepool_rewrite_config.sh'
        )
        connection.put(
            data.install_script('nodepool_config.sh'),
            'nodepool_config.sh'
        )
        connection.put(
            data.install_script('functions.sh'),
            'functions.sh'
        )
        connection.put(
            nodepool_config_file,
            'nodepool.yaml'
        )

        connection.put(
            args.nodepool_keyfile,
            'nodepool.priv'
        )

        connection.put(
            args.jenkins_keyfile,
            'jenkins.priv'
        )

        connection.run('%s bash nodepool_config.sh' % env.bashline)

        connection.run('rm -f nodepool_config.sh')
        connection.run('rm -f nodepool.yaml')
        connection.run('rm -f nodepool.priv')
        connection.run('rm -f jenkins.priv')
        connection.run('rm -f functions.sh')
        connection.run('rm -f nodepool_rewrite_config.sh')
Пример #4
0
def nodepool_rewrite_config():
    args = get_args_or_die(
        parse_nodepool_rewrite_config_args,
        issues_for_nodepool_rewrite_config
    )

    env = NodepoolConfigEnv(
        get_params_or_die(args.openrc),
        args.image_name,
        args.min_ready,
        args.rackspace_password,
        args.key_name,
        iad_max=args.iad_max,
        ord_max=args.ord_max,
        dfw_max=args.dfw_max
    )
    nodepool_config_file = data.nodepool_config(env.as_dict())

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(
            data.install_script('nodepool_rewrite_config.sh'),
            'nodepool_rewrite_config.sh'
        )
        connection.put(
            nodepool_config_file,
            'nodepool.yaml'
        )

        connection.run('bash nodepool_rewrite_config.sh')
        connection.run('rm -f nodepool_rewrite_config.sh')
        connection.run('rm -f nodepool.yaml')
Пример #5
0
def restore():
    args = get_args_or_die(parse_restore_args, issues_for_restore_args)

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(data.install_script('restore.sh'), 'restore.sh')
        connection.put(args.dump_file, 'osci-backup.tgz')
        connection.run('bash restore.sh')
        connection.run('rm -f restore.sh osci-backup.tgz')
Пример #6
0
def backup():
    args = get_args_or_die(parse_backup_args, issues_for_backup_args)

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(data.install_script('backup.sh'), 'backup.sh')
        connection.run('bash backup.sh')
        connection.get('osci-backup.tgz', args.output)
        connection.run('rm -f backup.sh osci-backup.tgz')
Пример #7
0
def osci_update():
    args = get_args_or_die(
        parse_osci_update_args,
        issues_for_osci_update_args)

    env = OSCIInstallEnv(
        args.osci_repo, args.osci_branch, 'IRRELEVANT', 'IRRELEVANT')

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(
            data.install_script('osci_release.sh'),
            'osci_release.sh'
        )
        connection.put(
            data.install_script('functions.sh'),
            'functions.sh'
        )
        connection.run(
            '%s bash osci_release.sh' % env.bashline
        )
        connection.run(
            'rm -f gerrit.key osci_release.sh functions.sh')
Пример #8
0
def osci_rewrite_config():
    args = get_args_or_die(
        parse_osci_rewrite_args,
        issues_for_osci_rewrite_args
    )

    env = OSCIConfigEnv(
        args.swift_api_key,
        args.image_name,
        args.vote
    )

    with remote.connect(args.username, args.host, args.port) as connection:
        connection.put(
            data.install_script('osci_rewrite_config.sh'),
            'osci_rewrite_config.sh'
        )
        connection.run('%s bash osci_rewrite_config.sh' % env.bashline)
        connection.run('rm -f osci_rewrite_config.sh')