@@ -4,7 +4,7 @@ import logging
44import sys
55import socket
66from cloudutils .cloudException import CloudRuntimeException , CloudInternalException
7- from cloudutils .utilities import initLoging
7+ from cloudutils .utilities import initLoging , bash
88from cloudutils .configFileOps import configFileOps
99from cloudutils .globalEnv import globalEnv
1010from cloudutils .networkConfig import networkConfig
@@ -13,7 +13,7 @@ from cloudutils.syscfg import sysConfigFactory
1313from optparse import OptionParser
1414
1515def getUserInputs ():
16- print "Welcome to myCloud Setup:"
16+ print "Welcome to Cloud Agent Setup:"
1717
1818 cfo = configFileOps ("/etc/cloud/agent/agent.properties" )
1919 oldMgt = cfo .getEntry ("host" )
@@ -28,11 +28,22 @@ def getUserInputs():
2828 exit (1 )
2929
3030 oldToken = cfo .getEntry ("zone" )
31- zoneToken = raw_input ("Please input the Zone Token :[%s]" % oldToken )
31+ zoneToken = raw_input ("Please input the Zone Id :[%s]" % oldToken )
3232
3333 if zoneToken == "" :
3434 zoneToken = oldToken
3535
36+ oldPod = cfo .getEntry ("pod" )
37+ podId = raw_input ("Please input the Pod Id:[%s]" % oldPod )
38+
39+ if podId == "" :
40+ podId = oldToken
41+
42+ oldCluster = cfo .getEntry ("cluster" )
43+ clusterId = raw_input ("Please input the Cluster Id:[%s]" % oldCluster )
44+ if clusterId == "" :
45+ clusterId = oldCluster
46+
3647 try :
3748 defaultNic = networkConfig .getDefaultNetwork ()
3849 except :
@@ -48,7 +59,7 @@ def getUserInputs():
4859 elif network == "" :
4960 network = defNic
5061
51- return [mgtSvr , zoneToken , network ]
62+ return [mgtSvr , zoneToken , network , podId , clusterId ]
5263
5364if __name__ == '__main__' :
5465 initLoging ("/var/log/cloud/setupAgent.log" )
@@ -73,6 +84,8 @@ if __name__ == '__main__':
7384 glbEnv .mgtSvr = userInputs [0 ]
7485 glbEnv .zone = userInputs [1 ]
7586 glbEnv .defaultNic = userInputs [2 ]
87+ glbEnv .pod = userInputs [3 ]
88+ glbEnv .cluster = userInputs [4 ]
7689 #generate UUID
7790 glbEnv .uuid = configFileOps ("/etc/cloud/agent/agent.properties" ).getEntry ("guid" )
7891 if glbEnv .uuid == "" :
0 commit comments