MCPcopy Create free account
hub / github.com/apache/cloudstack / list_zonespods

Function list_zonespods

python/lib/cloud_utils.py:372–380  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

370 check_call( ["rm","-rf",targetdir] )
371
372def list_zonespods(host):
373 text = urllib.request.urlopen('http://%s:8096/client/api?command=listPods'%host).read(-1)
374 dom = xml.dom.minidom.parseString(text)
375 x = [ (zonename,podname)
376 for pod in dom.childNodes[0].childNodes
377 for podname in [ x.childNodes[0].wholeText for x in pod.childNodes if x.tagName == "name" ]
378 for zonename in [ x.childNodes[0].wholeText for x in pod.childNodes if x.tagName == "zonename" ]
379 ]
380 return x
381
382def prompt_for_hostpods(zonespods):
383 """Ask user to select one from those zonespods

Callers 2

setup_agent_configFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected