From d2e544386098e1d2d25cf2d14734b065a1726977 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 24 Nov 2014 11:58:24 -0700 Subject: [PATCH 1/3] Add parser to jenkins.py --- tests/jenkins.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/jenkins.py b/tests/jenkins.py index f71ddfe0ca..8ba6d764e3 100644 --- a/tests/jenkins.py +++ b/tests/jenkins.py @@ -19,6 +19,7 @@ import time import shutil import optparse import subprocess +import argparse # Import Salt libs try: @@ -117,7 +118,7 @@ def delete_vm(options): proc.communicate() -def echo_parseable_environment(options): +def echo_parseable_environment(options, parser): ''' Echo NAME=VAL parseable output ''' @@ -365,6 +366,10 @@ def run(opts): ''' RUN! ''' + + parser = argparse.ArgumentParser( + description='Jenkins execution helper' + ) vm_name = os.environ.get( 'JENKINS_SALTCLOUD_VM_NAME', generate_vm_name(opts) @@ -959,7 +964,7 @@ def parse(): parser.exit('--provider or --pull-request is required') if options.echo_parseable_environment: - echo_parseable_environment(options) + echo_parseable_environment(options, parser) parser.exit(0) if not options.test_git_commit and not options.pull_request: From 512f07303a9357c8aca6187b00a3634c34621790 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 24 Nov 2014 12:13:38 -0700 Subject: [PATCH 2/3] Put the parser variable in the correct place --- tests/jenkins.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/jenkins.py b/tests/jenkins.py index 8ba6d764e3..a7f74d1d2e 100644 --- a/tests/jenkins.py +++ b/tests/jenkins.py @@ -366,10 +366,6 @@ def run(opts): ''' RUN! ''' - - parser = argparse.ArgumentParser( - description='Jenkins execution helper' - ) vm_name = os.environ.get( 'JENKINS_SALTCLOUD_VM_NAME', generate_vm_name(opts) From 022d2dbbfbbacf0751a26b02998561e089e8c676 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 24 Nov 2014 13:02:08 -0700 Subject: [PATCH 3/3] Remove unused import --- tests/jenkins.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/jenkins.py b/tests/jenkins.py index a7f74d1d2e..5e31e1c524 100644 --- a/tests/jenkins.py +++ b/tests/jenkins.py @@ -19,7 +19,6 @@ import time import shutil import optparse import subprocess -import argparse # Import Salt libs try: