@@ -28,34 +28,34 @@ from cloudutils.networkConfig import networkConfig
2828from cloudutils .syscfg import sysConfigFactory
2929
3030from optparse import OptionParser
31-
31+
3232def getUserInputs ():
33- print "Welcome to Cloud Agent Setup:"
33+ print "Welcome to the CloudStack Agent Setup:"
3434
35- cfo = configFileOps ("/etc/cloud/agent /agent.properties" )
35+ cfo = configFileOps ("@AGENTSYSCONFDIR@ /agent.properties" )
3636 oldMgt = cfo .getEntry ("host" )
3737
38- mgtSvr = raw_input ("Please input the Management Server Name /IP:[%s]" % oldMgt )
38+ mgtSvr = raw_input ("Please input the Management Server Hostname /IP-Address :[%s]" % oldMgt )
3939 if mgtSvr == "" :
4040 mgtSvr = oldMgt
4141 try :
4242 socket .getaddrinfo (mgtSvr , 443 )
4343 except :
44- print "Failed to resolve %s. Please input correct server name or IP." % mgtSvr
44+ print "Failed to resolve %s. Please input a valid hostname or IP-Address ." % mgtSvr
4545 exit (1 )
4646
4747 oldToken = cfo .getEntry ("zone" )
4848 zoneToken = raw_input ("Please input the Zone Id:[%s]" % oldToken )
49-
49+
5050 if zoneToken == "" :
5151 zoneToken = oldToken
5252
5353 oldPod = cfo .getEntry ("pod" )
5454 podId = raw_input ("Please input the Pod Id:[%s]" % oldPod )
55-
55+
5656 if podId == "" :
5757 podId = oldToken
58-
58+
5959 oldCluster = cfo .getEntry ("cluster" )
6060 clusterId = raw_input ("Please input the Cluster Id:[%s]" % oldCluster )
6161 if clusterId == "" :
@@ -66,7 +66,7 @@ def getUserInputs():
6666 except :
6767 print "Failed to get default route. Please configure your network to have a default route"
6868 exit (1 )
69-
69+
7070 defNic = defaultNic .name
7171 network = raw_input ("Please choose which network used to create VM:[%s]" % defNic )
7272 if network == "" :
@@ -79,21 +79,21 @@ def getUserInputs():
7979 return [mgtSvr , zoneToken , network , podId , clusterId ]
8080
8181if __name__ == '__main__' :
82- initLoging ("/var/log/cloud/setupAgent .log" )
82+ initLoging ("@AGENTLOGDIR@/setup .log" )
8383 glbEnv = globalEnv ()
8484
8585 glbEnv .mode = "Agent"
8686 glbEnv .agentMode = "Agent"
8787 parser = OptionParser ()
8888 parser .add_option ("-a" , action = "store_true" , dest = "auto" , help = "auto mode" )
89- parser .add_option ("-m" , "--host" , dest = "mgt" , help = "management server name or IP" )
89+ parser .add_option ("-m" , "--host" , dest = "mgt" , help = "Management server hostname or IP-Address " )
9090 parser .add_option ("-z" , "--zone" , dest = "zone" , help = "zone id" )
9191 parser .add_option ("-p" , "--pod" , dest = "pod" , help = "pod id" )
9292 parser .add_option ("-c" , "--cluster" , dest = "cluster" , help = "cluster id" )
9393 parser .add_option ("-g" , "--guid" , dest = "guid" , help = "guid" )
94- parser .add_option ("--pubNic" , dest = "pubNic" , help = "public nic " )
95- parser .add_option ("--prvNic" , dest = "prvNic" , help = "private nic " )
96- parser .add_option ("--guestNic" , dest = "guestNic" , help = "guest nic " )
94+ parser .add_option ("--pubNic" , dest = "pubNic" , help = "Public traffic interface " )
95+ parser .add_option ("--prvNic" , dest = "prvNic" , help = "Private traffic interface " )
96+ parser .add_option ("--guestNic" , dest = "guestNic" , help = "Guest traffic interface " )
9797
9898 (options , args ) = parser .parse_args ()
9999 if options .auto is None :
@@ -104,7 +104,7 @@ if __name__ == '__main__':
104104 glbEnv .pod = userInputs [3 ]
105105 glbEnv .cluster = userInputs [4 ]
106106 #generate UUID
107- glbEnv .uuid = configFileOps ("/etc/cloud/agent /agent.properties" ).getEntry ("guid" )
107+ glbEnv .uuid = configFileOps ("@AGENTSYSCONFDIR@ /agent.properties" ).getEntry ("guid" )
108108 if glbEnv .uuid == "" :
109109 glbEnv .uuid = bash ("uuidgen" ).getStdout ()
110110 else :
@@ -127,7 +127,7 @@ if __name__ == '__main__':
127127 syscfg = sysConfigFactory .getSysConfigFactory (glbEnv )
128128 try :
129129 syscfg .config ()
130- print "Cloud Agent setup is Done !"
130+ print "CloudStack Agent setup is done !"
131131 except (CloudRuntimeException ,CloudInternalException ), e :
132132 print e
133133 print "Try to restore your system:"
0 commit comments