Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To make the Inresino #2

Open
wants to merge 38 commits into
base: valid_kbidarka
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c0416e4
changed lines from 200 to 500 for logging
weshayutin Aug 31, 2011
d40e60d
asdf
weshayutin Sep 7, 2011
2c9ab3c
fixed syntax error
Sep 7, 2011
3672b42
fixed hard code bug entry
weshayutin Sep 7, 2011
e4dd3de
fixed noGit option
weshayutin Sep 8, 2011
8126d91
Added -dest attribute for NOGIT
sghai Sep 9, 2011
e7c62cd
Merge branch 'master' of github.com:weshayutin/valid
kbidarkar Sep 9, 2011
48fc352
In BZ, Cloud image validation product requires version changes
sghai Sep 9, 2011
2e0aa20
Added 2 files for CSV usage, also getAmiDetails_withCSV uses rhui_lib…
kbidarkar Sep 9, 2011
598fa44
Merge branch 'master' of github.com:weshayutin/valid
kbidarkar Sep 9, 2011
feb2a54
Added Install wget, validate signature for fetch_host_details function
kbidarkar Sep 12, 2011
e65f136
Changed 13G to 15G for resize2fs
kbidarkar Sep 12, 2011
3c86318
Modified m2xlarge hwp profile
kbidarkar Sep 13, 2011
1b09941
fixed firstboot title
weshayutin Sep 13, 2011
58b37b9
added imageid to postreboot, modified resize2fs, swap functions for 7…
kbidarkar Sep 14, 2011
384d8d9
Merge branch 'master' of github.com:weshayutin/valid
kbidarkar Sep 14, 2011
329d506
added open bugzilla function to postreboot
kbidarkar Sep 14, 2011
24a2a9b
Removed sleep from resize2fs
sghai Sep 14, 2011
9e839aa
if t1.micro no swap tests, after yum update reset default
kbidarkar Sep 14, 2011
4f4112e
Merge branch 'master' of github.com:weshayutin/valid
kbidarkar Sep 14, 2011
ff818b7
rectified improper if else syntax
kbidarkar Sep 14, 2011
ac558ea
t1.micro rectified
kbidarkar Sep 14, 2011
b93fbc1
modified fetch_host_details function, to verify cloud access ami's
kbidarkar Sep 27, 2011
49cf0cc
The script now uses validation.cfg file instead of cli arg, added fur…
kbidarkar Oct 7, 2011
0ade0ad
Added a sample cfg file
kbidarkar Oct 7, 2011
f0a1119
Solved some weired indentation issues
kbidarkar Oct 11, 2011
b525d8b
resolved swap function issues
kbidarkar Oct 11, 2011
d856128
added utility script for dc
weshayutin Oct 13, 2011
44545a0
few modifications for RHEL 6.2
kbidarkar Oct 19, 2011
f8d7f62
package_62 added, modified scripts for new region
kbidarkar Nov 21, 2011
70e4a3e
modified the validation.cfg template
kbidarkar Nov 21, 2011
4f88cd6
removed abrt packages from packages_62 file
kbidarkar Nov 29, 2011
a2f5a1c
init skip test
Dec 13, 2011
bcf2d54
fix loading testlib
dparalen Dec 14, 2011
6701455
bug fixes...
dparalen Dec 14, 2011
4296bcc
Merge pull request #1 from dparalen/master
weshayutin Dec 14, 2011
ba51632
moved REPO
weshayutin Dec 15, 2011
1f15b8f
added stupid install script for rhui
weshayutin Mar 2, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
This script will run through some basic sanity tests for a Red Hat Enterprise Linux image
A valid Red Hat bugzilla username and password will be required at the end of the script
http://bugzilla.redhat.com/


USAGE image_validation --help
MOVED TO https://github.com/RedHatQE/valid
MOVED TO https://github.com/RedHatQE/valid
MOVED TO https://github.com/RedHatQE/valid
MOVED TO https://github.com/RedHatQE/valid
MOVED TO https://github.com/RedHatQE/valid
MOVED TO https://github.com/RedHatQE/valid
MOVED TO https://github.com/RedHatQE/valid
Binary file modified src/bugzilla/__init__.pyc
Binary file not shown.
Binary file modified src/bugzilla/base.pyc
Binary file not shown.
Binary file modified src/bugzilla/bugzilla3.pyc
Binary file not shown.
Binary file modified src/bugzilla/nvlbugzilla.pyc
Binary file not shown.
Binary file modified src/bugzilla/rhbugzilla.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion src/bugzilla/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def open_without_clobber(name, *args):
while fd is None:
try:
fd = os.open(name, os.O_CREAT|os.O_EXCL, 0666)
except OSError as e:
except OSError, e:
if e.errno == os.errno.EEXIST:
name = "%s.%i" % (orig_name, count)
count += 1
Expand Down
Binary file modified src/bugzilla/util.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions src/getAmiDetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
parser.add_option('-z','--bugzilla_password', type='string',dest='BZPASS',help='bugzilla password')
parser.add_option('-m','--arch', dest='ARCH', default='x86_64', help='arch = i386, or x86_64')
parser.add_option('-x','--ignore', dest='IGNORE', default='IGNORE', help='If set.. ignore the generated bug') #c1.medium
parser.add_option('-g','--noGit',dest='NOGIT', default=False, help='If set.. do not pull valid src from git, scp to each instance' )
parser.add_option('-g','--noGit',dest="NOGIT", default=True, help='If set.. do not pull valid src from git, scp to each instance' )
#parser.add_option('-g','--noGit',action="store_true", default=True, help='If set.. do not pull valid src from git, scp to each instance' )
parser.add_option('-d','--baseDir',dest='BASEDIR',type='string',help='the dir of the src checkout ie.. ~/workspace/valid/src')


Expand Down Expand Up @@ -66,7 +67,8 @@
print "**** No bugzilla # was passed, will open one here ****"
bugzilla=Bugzilla36(url='https://bugzilla.redhat.com/xmlrpc.cgi',user=BZUSER,password=BZPASS)
mySummary=AMI+" "+RHEL+" "+ARCH+" "+REGION
BZ_Object=bugzilla.createbug(product="Cloud Image Validation",component="images",version="RHEL6.1",rep_platform="x86_64",summary=mySummary)
RHV="RHEL"+RHEL
BZ_Object=bugzilla.createbug(product="Cloud Image Validation",component="images",version=RHV,rep_platform=ARCH,summary=mySummary)
BZ = str(BZ_Object.bug_id)
print "Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ
else:
Expand Down
341 changes: 341 additions & 0 deletions src/getAmiDetails_withCSV.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,341 @@
#!/usr/bin/python -tt

from pprint import pprint
from boto import ec2
import boto, thread
import sys, time, argparse, os
import csv
#from boto.ec2.blockdevicemapping import BlockDeviceMapping
from boto.ec2.blockdevicemapping import EBSBlockDeviceType, BlockDeviceMapping
from bugzilla.bugzilla3 import Bugzilla36
import rhui_lib
import ConfigParser

config = ConfigParser.ConfigParser()
config.read('/etc/validation.cfg')

argparser = argparse.ArgumentParser(description=\
'Remotely execute validation testcases')
argparser.add_argument('--skip-tests', metavar='<expr>',nargs="*",
help="space-separated expressions describing tests to skip")
argparser.add_argument('--list-tests', action='store_const', const=True,
default=False, help='display available test names and exit')
args = argparser.parse_args()

if args.skip_tests:
SKIPLIST=",".join(args.skip_tests)
else:
SKIPLIST=""

if args.list_tests:
os.system("./image_validation.sh --list-tests")
sys.exit()

#us-west-2 has been used as SSHKEY_US_O and SSHKEY_NAME_US_O, O stands for
#Oregon

SSHKEY_NAME_AP_S = config.get('SSH-Info', 'ssh-key-name_apsouth')
SSHKEY_AP_S = config.get('SSH-Info', 'ssh-key-path_apsouth')
SSHKEY_NAME_AP_N = config.get('SSH-Info', 'ssh-key-name_apnorth')
SSHKEY_AP_N = config.get('SSH-Info', 'ssh-key-path_apnorth')
SSHKEY_NAME_EU_W = config.get('SSH-Info', 'ssh-key-name_euwest')
SSHKEY_EU_W = config.get('SSH-Info', 'ssh-key-path_euwest')
SSHKEY_NAME_US_W = config.get('SSH-Info', 'ssh-key-name_uswest')
SSHKEY_US_W = config.get('SSH-Info', 'ssh-key-path_uswest')
SSHKEY_NAME_US_E = config.get('SSH-Info', 'ssh-key-name_useast')
SSHKEY_US_E = config.get('SSH-Info', 'ssh-key-path_useast')
SSHKEY_NAME_US_O = config.get('SSH-Info', 'ssh-key-name_uswest-oregon')
SSHKEY_US_O = config.get('SSH-Info', 'ssh-key-path_uswest-oregon')

BZUSER = config.get('Bugzilla-Info', 'bugzilla_usr')
BZPASS = config.get('Bugzilla-Info', 'bugzilla_pwd')

AWS_ACCESS_KEY_ID = config.get('EC2-Keys', 'ec2-key')
AWS_SECRET_ACCESS_KEY = config.get('EC2-Keys', 'ec2-secret-key')

CSV = config.get('Misc-Info', 'csv')
NOGIT = config.get('Misc-Info', 'git')
BASEDIR = config.get('Misc-Info', 'basedir')

BZ = None

val1 = {
'SSHKEY_US_E': SSHKEY_US_E,
'SSHKEY_NAME_US_E': SSHKEY_NAME_US_E,
'SSHKEY_US_O': SSHKEY_US_O,
'SSHKEY_NAME_US_O': SSHKEY_NAME_US_O,
'SSHKEY_US_W': SSHKEY_US_W,
'SSHKEY_NAME_US_W': SSHKEY_NAME_US_W,
'SSHKEY_EU_W': SSHKEY_EU_W,
'SSHKEY_NAME_EU_W': SSHKEY_NAME_EU_W,
'SSHKEY_AP_N': SSHKEY_AP_N,
'SSHKEY_NAME_AP_N': SSHKEY_NAME_AP_N,
'SSHKEY_AP_S': SSHKEY_AP_S,
'SSHKEY_NAME_AP_S': SSHKEY_NAME_AP_S,
'BZUSER': BZUSER,
'BZPASS': BZPASS,
'AWS_ACCESS_KEY_ID': AWS_ACCESS_KEY_ID,
'AWS_SECRET_ACCESS_KEY': AWS_SECRET_ACCESS_KEY,
'CSV': CSV,
'NOGIT': NOGIT,
'BASEDIR': BASEDIR,
}

for v in val1:
if not val1[v]:
print "The value ", v, "is missing in .cfg file."
sys.exit()

CSVFILE = "test1.csv"

def addBugzilla(BZ, AMI, RHEL, ARCH, REGION):
if BZ is None:
print "**** No bugzilla # was passed, will open one here ****"
bugzilla=Bugzilla36(url='https://bugzilla.redhat.com/xmlrpc.cgi',user=BZUSER,password=BZPASS)
mySummary=AMI+" "+RHEL+" "+ARCH+" "+REGION
RHV = "RHEL"+RHEL
BZ_Object=bugzilla.createbug(product="Cloud Image Validation",component="images",version=RHV,rep_platform=ARCH,summary=mySummary)
BZ = str(BZ_Object.bug_id)
print "Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ
return BZ
else:
mySummary=AMI+" "+RHEL+" "+ARCH+" "+REGION
print "Already opened Buzilla # = https://bugzilla.redhat.com/show_bug.cgi?id="+ BZ
return BZ

file = open('/tmp/bugzilla',"a")
file.write("\n")
file.write(BZ)
file.write("\t")
file.write(mySummary)
file.close()
os.system("cp "+BASEDIR+"/nohup.out "+BASEDIR+"/nohup_"+AMI+".out ; cat /dev/null > "+BASEDIR+"/nohup.out")

if CSV == 'false':
BID = addBugzilla(BZ, AMI, RHEL, ARCH, REGION)


def getConnection(key, secret, region):
"""establish a connection with ec2"""
reg = boto.ec2.get_region(region, aws_access_key_id=key, aws_secret_access_key=secret)
return reg.connect(aws_access_key_id=key, aws_secret_access_key=secret)

#east# reservation = ec2conn.run_instances('ami-8c8a7de5', instance_type='t1.micro', key_name='cloude-key')
#block_device_map
#'/dev/sda=:20'

def startInstance(ec2connection, hardwareProfile, ARCH, RHEL, AMI, SSHKEYNAME):
conn_region = ec2connection
map = BlockDeviceMapping()
t = EBSBlockDeviceType()
t.size = '15'
#map = {'DeviceName':'/dev/sda','VolumeSize':'15'}
map['/dev/sda1'] = t

#blockDeviceMap = []
#blockDeviceMap.append( {'DeviceName':'/dev/sda', 'Ebs':{'VolumeSize' : '100'} })

if ARCH == 'i386' and RHEL == '6.1':
reservation = conn_region.run_instances(AMI, instance_type=hardwareProfile, key_name=SSHKEYNAME, block_device_map=map )
elif ARCH == 'x86_64' and RHEL == '6.1':
reservation = conn_region.run_instances(AMI, instance_type=hardwareProfile, key_name=SSHKEYNAME, block_device_map=map )
elif ARCH == 'i386':
reservation = conn_region.run_instances(AMI, instance_type=hardwareProfile, key_name=SSHKEYNAME, block_device_map=map )
elif ARCH == 'x86_64':
reservation = conn_region.run_instances(AMI, instance_type=hardwareProfile, key_name=SSHKEYNAME, block_device_map=map)
else:
print "arch type is neither i386 or x86_64.. will exit"
exit(1)

myinstance = reservation.instances[0]

time.sleep(5)
while(not myinstance.update() == 'running'):
time.sleep(5)
print myinstance.update()

instanceDetails = myinstance.__dict__
pprint(instanceDetails)
#region = instanceDetails['placement']
#print 'region =' + region
publicDNS = instanceDetails['public_dns_name']
print 'public hostname = ' + publicDNS
# check for console output here to make sure ssh is up
return publicDNS

def executeValidScript(SSHKEY, publicDNS, hwp, BZ, ARCH, AMI, REGION, RHEL, SKIPLIST=""):
filepath = BASEDIR
serverpath = "/root/valid"
commandPath = "/root/valid/src"

if NOGIT == 'false':
if hwp["name"] == 't1.micro':
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" mkdir -p /root/valid")
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" touch /root/noswap")
else:
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" mkdir -p /root/valid")
print "scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " -r " + filepath + " root@"+publicDNS+":"+serverpath+"\n"
os.system("scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " -r " + filepath + " root@"+publicDNS+":"+serverpath)
elif NOGIT == 'true':
if hwp["name"] == 't1.micro':
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" touch /root/noswap")
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" yum -y install git")
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" git clone git://github.com/dparalen/valid.git")


# COPY KERNEL if there
serverpath = "/root/kernel"
os.system("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" mkdir -p /root/kernel")
if ARCH == 'i386':
filepath = BASEDIR+"/kernel/i386/*"
print "scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " -r " + filepath + " root@"+publicDNS+":"+serverpath+"\n"
os.system("scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " -r " + filepath + " root@"+publicDNS+":"+serverpath)
if ARCH == 'x86_64':
filepath = BASEDIR+"/kernel/x86_64/*"
print "scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " -r " + filepath + " root@"+publicDNS+":"+serverpath+"\n"
os.system("scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " -r " + filepath + " root@"+publicDNS+":"+serverpath)



# command = commandPath+"/image_validation.sh --imageID="+IGNORE+AMI+"_"+REGION+"_"+hwp["name"]+" --RHEL="+RHEL+" --full-yum-suite=yes --skip-questions=yes --bugzilla-username="+BZUSER+" --bugzilla-password="+BZPASS+" --bugzilla-num="+BZ+ " --memory="+hwp["memory"]
command = commandPath+"/image_validation.sh --skip-list='"+SKIPLIST+"' --imageID="+AMI+"_"+REGION+"_"+hwp["name"]+" --RHEL="+RHEL+" --full-yum-suite=yes --skip-questions=yes --bugzilla-username="+BZUSER+" --bugzilla-password='"+BZPASS+"' --bugzilla-num="+BZ+ " --memory="+hwp["memory"]+" --public-dns="+publicDNS+" --ami-id="+AMI+" --arch-id="+ARCH

print "nohup ssh -n -f -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" "+command
print ""
os.system("nohup ssh -n -f -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "+SSHKEY+ " root@"+publicDNS+" "+command)


def printValues(hwp):
print "+++++++"
print AMI
print REGION
print SSHKEY
print RHEL
print hwp
print "+++++++\n"

def myfunction(string, sleeptime,lock,SSHKEY,publicDNS):
#entering critical section
lock.acquire()
print string," Now Sleeping after Lock acquired for ",sleeptime
time.sleep(sleeptime)

print string," Now releasing lock and then sleeping again"
lock.release()

#exiting critical section
time.sleep(sleeptime) # why?

# Define hwp
m1Small = {"name":"m1.small","memory":"1700000","cpu":"1","arch":"i386"}
m1Large = {"name":"m1.large","memory":"7500000","cpu":"2","arch":"x86_64"}
m1Xlarge = {"name":"m1.xlarge","memory":"15000000","cpu":"4","arch":"x86_64"}
t1Micro = {"name":"t1.micro","memory":"600000","cpu":"1","arch":"both"}
m2Xlarge = {"name":"m2.xlarge","memory":"17100000","cpu":"2","arch":"x86_64"}
m22Xlarge = {"name":"m2.2xlarge","memory":"34200000","cpu":"4","arch":"x86_64"}
m24Xlarge = {"name":"m2.4xlarge","memory":"68400000","cpu":"8","arch":"x86_64"}
c1Medium = {"name":"c1.medium","memory":"1700000","cpu":"2","arch":"i386"}
c1Xlarge = {"name":"c1.xlarge","memory":"7000000","cpu":"8","arch":"x86_64"}


#Use all hwp types for ec2 memory tests, other hwp tests
hwp_i386 = [c1Medium, t1Micro , m1Small ]
#hwp_i386 = [c1Medium]
hwp_x86_64 = [m1Xlarge, t1Micro , m1Large , m2Xlarge, m22Xlarge, m24Xlarge , c1Xlarge]
#hwp_x86_64 = [m24Xlarge]

#Use just one hwp for os tests
#hwp_i386 = [c1Medium]
#hwp_x86_64 = [m1Xlarge,m22Xlarge]
if CSV == 'true':
reader = csv.reader(open(CSVFILE,"rb"))
fields = reader.next()
ami = [(row[0], row[1], row[2], row[3], row[4], row[5]) for row in reader]
for x in range(len(ami)):
myRow = ami[x]
print myRow
ARCH = myRow[0]
REGION = myRow[1]
RHEL = myRow[4]
# BZ = myRow[3]
AMI = myRow[5]

BID = addBugzilla(BZ, AMI, RHEL, ARCH, REGION)

if REGION == "us-east-1":
SSHKEY = SSHKEY_US_E
SSHKEYNAME = SSHKEY_NAME_US_E
elif REGION == "us-west-2":
SSHKEY = SSHKEY_US_O
SSHKEYNAME = SSHKEY_NAME_US_O
elif REGION == "us-west-1":
SSHKEY = SSHKEY_US_W
SSHKEYNAME = SSHKEY_NAME_US_W
elif REGION == "eu-west-1":
SSHKEY = SSHKEY_EU_W
SSHKEYNAME = SSHKEY_NAME_EU_W
elif REGION == "ap-southeast-1":
SSHKEY = SSHKEY_AP_S
SSHKEYNAME = SSHKEY_NAME_AP_S
elif REGION == "ap-northeast-1":
SSHKEY = SSHKEY_AP_N
SSHKEYNAME = SSHKEY_NAME_AP_N


publicDNS = []
if ARCH == 'i386':
for hwp in hwp_i386:
printValues(hwp)
myConn = getConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REGION)
this_hostname = startInstance(myConn, hwp["name"], ARCH, RHEL, AMI, SSHKEYNAME)
map = {"hostname":this_hostname,"hwp":hwp}
publicDNS.append(map)
elif ARCH == 'x86_64':
for hwp in hwp_x86_64:
printValues(hwp)
myConn = getConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REGION)
this_hostname = startInstance(myConn, hwp["name"], ARCH, RHEL, AMI, SSHKEYNAME)
map = {"hostname":this_hostname,"hwp":hwp}
publicDNS.append(map)

lock = thread.allocate_lock()
# print "sleep for 130 seconds"
# time.sleep(130)
print "Trying to fetch a file to make sure the SSH works, before proceeding ahead."
f_path = "/tmp/network"
l_path = "/etc/init.d/network"
for host in publicDNS:
keystat = rhui_lib.putfile(host["hostname"], SSHKEY, l_path, f_path)
if not keystat:
executeValidScript(SSHKEY, host["hostname"], host["hwp"], BID, ARCH, AMI, REGION, RHEL, SKIPLIST)
else:
print "The Amazon node : "+host["hostname"]+" is not accessible, waited for 210 sec. Skipping and proceeding with the next Profile"
else:
publicDNS = []
if ARCH == 'i386':
for hwp in hwp_i386:
printValues(hwp)
myConn = getConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REGION)
this_hostname = startInstance(myConn, hwp["name"], ARCH, RHEL, AMI, SSHKEYNAME)
map = {"hostname":this_hostname,"hwp":hwp}
publicDNS.append(map)
elif ARCH == 'x86_64':
for hwp in hwp_x86_64:
printValues(hwp)
myConn = getConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REGION)
this_hostname = startInstance(myConn, hwp["name"], ARCH, RHEL, AMI, SSHKEYNAME)
map = {"hostname":this_hostname,"hwp":hwp}
publicDNS.append(map)

lock = thread.allocate_lock()
# print "sleep for 130 seconds"
# time.sleep(130)
print "Trying to fetch a file and make sure the SSH works, before proceeding ahead."
f_path = "/tmp/network"
l_path = "/etc/init.d/network"
for host in publicDNS:
keystat = rhui_lib.putfile(host["hostname"], SSHKEY, l_path, f_path)
if not keystat:
executeValidScript(SSHKEY, host["hostname"],host["hwp"], BID, ARCH, AMI, REGION, RHEL, SKIPLIST)
else:
print "The Amazon node : "+host["hostname"]+" is not accessible, waited for 210 sec. Skipping and proceeding with the next Profile"
Loading