mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add parser to jenkins.py
This commit is contained in:
parent
ed6bc7b24f
commit
d2e5443860
1 changed files with 7 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue