def get_graphics(vm_):
 out = {'autoport': 'None', 'keymap': 'None', 'listen': 'None', 'port': 'None', 'type': 'None'}
 xml = get_xml(vm_)
 ssock = _StringIO(xml)
 doc = minidom.parse(ssock)
 for node in doc.getElementsByTagName('domain'):
  g_nodes = node.getElementsByTagName('graphics')
  for g_node in g_nodes:
   for (key, value) in g_node.attributes.items():
    out[key] = value
 return out

def get_graphics ( vm_ ) : out = { 'autoport' : 'None' , 'keymap' : 'None' , 'listen' : 'None' , 'port' : 'None' , 'type' : 'None' } xml = get_xml ( vm_ ) ssock = _StringIO ( xml ) doc = minidom . parse ( ssock ) for node in doc . getElementsByTagName ( 'domain' ) : g_nodes = node . getElementsByTagName ( 'graphics' ) for g_node in g_nodes : for ( key , value ) in g_node . attributes . items ( ) : out [ key ] = value return out
returns the information on vnc for a given vm cli example: .