From aa19c33e20f0ac56dbee5a8bb24605d965460d28 Mon Sep 17 00:00:00 2001 From: Niranjan Mallapadi Date: Wed, 19 Nov 2014 19:04:55 +0530 Subject: [PATCH 1/3] Add repo url to rhcs.conf, use url in rhcs_ci.py --- etc/rhcs.conf | 1 + projects/rhcs_ci.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/etc/rhcs.conf b/etc/rhcs.conf index e0f0b05..22feab7 100644 --- a/etc/rhcs.conf +++ b/etc/rhcs.conf @@ -1,5 +1,6 @@ [global] restraint_jobs = pki-tests/restraint +rhcs9_build_repo = https://idm-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/RHCS9%20Build%20Repo/ws/myrepo_0.repo [dogtag-cert-cli-fedora20-x86_64-bkr-2-runtest] job_name = cert-cli.xml diff --git a/projects/rhcs_ci.py b/projects/rhcs_ci.py index c2bdb51..f0cd94e 100644 --- a/projects/rhcs_ci.py +++ b/projects/rhcs_ci.py @@ -38,6 +38,27 @@ def existing_nodes(): my_nodes = existing_nodes.identify_nodes() return my_nodes +def wget_repo(my_nodes, job_name): + """Wget the brew build repo in all the existing nodes""" + + global_config = ConfigParser.SafeConfigParser() + global_config.read("etc/global.conf") + username = global_config.get('global', 'username') + password = global_config.get('global', 'password') + + rhcs_config = ConfigParser.SafeConfigParser() + rhcs_config.read("etc/rhcs.conf") + repo_url = rhcs_config.get('global','rhcs9_build_repo') + get_repo = ("wget --no-check-certificate %s -O /etc/yum.repos.d/myrepo_0.repo" % repo_url) + for node in my_nodes: + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(node, username=username,password=password) + common.util.log.info("Executing command %s" % get_repo) + stdin, stdout, stderr = ssh.exec_command(get_repo) + for line in stdout.read().splitlines(): + common.util.log.info('host: %s: %s' % (node, line)) + def restraint_setup(): """ Configures restraint on beaker nodes """ From d7d1133f19d1d6c80b81b86ff4af8fb486ed5c2c Mon Sep 17 00:00:00 2001 From: Niranjan Mallapadi Date: Thu, 20 Nov 2014 04:59:52 +0530 Subject: [PATCH 2/3] use RawConfigParser instead of SafeConfigParser --- projects/rhcs_ci.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rhcs_ci.py b/projects/rhcs_ci.py index f0cd94e..cbfdce5 100644 --- a/projects/rhcs_ci.py +++ b/projects/rhcs_ci.py @@ -46,7 +46,7 @@ def wget_repo(my_nodes, job_name): username = global_config.get('global', 'username') password = global_config.get('global', 'password') - rhcs_config = ConfigParser.SafeConfigParser() + rhcs_config = ConfigParser.RawConfigParser() rhcs_config.read("etc/rhcs.conf") repo_url = rhcs_config.get('global','rhcs9_build_repo') get_repo = ("wget --no-check-certificate %s -O /etc/yum.repos.d/myrepo_0.repo" % repo_url) From 29148571931b913ee2e28decec29890c12d86327 Mon Sep 17 00:00:00 2001 From: Niranjan Mallapadi Date: Thu, 20 Nov 2014 05:52:28 +0530 Subject: [PATCH 3/3] Call wget_repo function in beaker run --- projects/rhcs_ci.py | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/rhcs_ci.py b/projects/rhcs_ci.py index cbfdce5..85c8c03 100644 --- a/projects/rhcs_ci.py +++ b/projects/rhcs_ci.py @@ -124,6 +124,7 @@ def beaker_run(): """ Calls restraint and provides the junit file """ job_name = get_workspace() my_nodes = existing_nodes() + wget_repo_file = wget_repo(my_nodes, job_name) restraint_inst = restraint_setup() restraint_loc = restraint_location()