forked from andaok/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.conf
More file actions
47 lines (40 loc) · 1.73 KB
/
setup.conf
File metadata and controls
47 lines (40 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#test######
#xmlfile="test.xml"
#xmltree=ET.parse(xmlfile)
#xmlroot=xmltree.getroot()
###########
connode = getConnObj()
xmlstring = connode.getCapabilities()
xmlroot=ET.fromstring(xmlstring)
cputopxmllist = xmlroot.findall("host/topology/cells/cell")
phycpunum = len(cputopxmllist)
cputoplist = []
for cell in cputopxmllist:
dict = {}
dict['phycpusn'] = cell.get("id")
cpulist = cell.findall("cpus/cpu")
dict['cpucorenum'] = len(cpulist)
cpuid = ""
for cpu in cpulist:
cpuid = cpuid+cpu.get("id")+","
dict['cpuid'] = cpuid[0:-1].strip()
cputoplist.append(dict)
return cputoplist
config = ConfigParser.ConfigParser()
config.read(configfile)
cpuauthprikeyfile = CloudiyaInsDir+config.get("cpuauth", "cpuauthprikeyfile")
cpuauthrepubkeyfile = CloudiyaInsDir+config.get("cpuauth", "cpuauthrepubkeyfile")
cpuauthreprikeyfile = CloudiyaInsDir+config.get("cpuauth", "cpuauthreprikeyfile")
cpuauthrefile = CloudiyaInsDir+config.get("cpuauth", "cpuauthrefile")
wshostname = config.get("ws", "wshostname")
wsport = config.get("ws", "wsport")
######################
#Get command input arguments
######################
cmdopt = optparse.OptionParser(description="import license file for this node",
prog="CloudiyaNodeAuth.py" ,
version="1.0",
usage="%prog --licensefile licensefilepath" )
cmdopt.add_option('-f','--licensefile',help="license file for this node")
options,arguments = cmdopt.parse_args()
cpuauthfile = options.licensefile.strip()