def get_vnc_console(self, context, instance):

    def get_vnc_port_for_instance(instance_name):
        virt_dom = self._lookup_by_name(instance_name)
        xml = virt_dom.XMLDesc(0)
        dom = xmlutils.safe_minidom_parse_string(xml)
        for graphic in dom.getElementsByTagName('graphics'):
            if (graphic.getAttribute('type') == 'vnc'):
                return graphic.getAttribute('port')
        raise exception.ConsoleTypeUnavailable(console_type='vnc')
    port = get_vnc_port_for_instance(instance.name)
    host = CONF.vncserver_proxyclient_address
    return {'host': host, 'port': port, 'internal_access_path': None}
def get_vnc_console(self, context, instance):

    def get_vnc_port_for_instance(instance_name):
        virt_dom = self._lookup_by_name(instance_name)
        xml = virt_dom.XMLDesc(0)
        dom = xmlutils.safe_minidom_parse_string(xml)
        for graphic in dom.getElementsByTagName('graphics'):
            if (graphic.getAttribute('type') == 'vnc'):
                return graphic.getAttribute('port')
        raise exception.ConsoleTypeUnavailable(console_type='vnc')
    port = get_vnc_port_for_instance(instance.name)
    host = CONF.vncserver_proxyclient_address
    return {'host': host, 'port': port, 'internal_access_path': None}