mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
updates to jenkins test script
This commit is contained in:
parent
d50d438545
commit
1f17e10ef7
@ -6,6 +6,8 @@ jenkins.satstack.com.
|
|||||||
This script is intended to be shell centric!!
|
This script is intended to be shell centric!!
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
# Import python libs
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import hashlib
|
import hashlib
|
||||||
import random
|
import random
|
||||||
@ -29,3 +31,24 @@ def run(platform, provider):
|
|||||||
subprocess.call(
|
subprocess.call(
|
||||||
'salt-cloud -d {0} -y'.format(vm_name),
|
'salt-cloud -d {0} -y'.format(vm_name),
|
||||||
shell=True)
|
shell=True)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def parse():
|
||||||
|
'''
|
||||||
|
Parse the cli options
|
||||||
|
'''
|
||||||
|
parser = optparse.OptionParser()
|
||||||
|
parser.add_option('--platform',
|
||||||
|
dest='platform',
|
||||||
|
help='The target platform, choose from:\ncent6\ncent5\nubuntu12.04')
|
||||||
|
parser.add_option('--provider',
|
||||||
|
dest='provider',
|
||||||
|
help='The vm provider')
|
||||||
|
options, args = parser.parse_args()
|
||||||
|
return options.__dict__()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
opts = parse()
|
||||||
|
exit_code = run(opts['platform'], opts['provider'])
|
||||||
|
sys.exit(exit_code)
|
||||||
|
Loading…
Reference in New Issue
Block a user