

@auth
def _GET(self, *param, **params):
    models = findbyhostall(self.orm)
    uris = available_virt_uris()
    try:
        conf = env.get('KARESANSUI_CONF')
        _K2V = K2V(conf)
        config = _K2V.read()
    except (IOError, KaresansuiGadgetException):
        raise KaresansuiGadgetException
    self.view.application_uniqkey = config['application.uniqkey']
    port_number = 443
    try:
        hosts = []
        for model in models:
            if ((model.attribute == 0) and (model.hypervisor == 1)):
                uri = uris['XEN']
            elif ((model.attribute == 0) and (model.hypervisor == 2)):
                uri = uris['KVM']
            else:
                uri = None
            self.kvc = KaresansuiVirtConnection(uri)
            host = MergeHost(self.kvc, model)
            host.info['model'].is_ssl = is_ssl(host.info['model'].hostname)
            host.info['model'].port_number = port_number
            hosts.append(host)
        self.view.machines = hosts
    except KaresansuiVirtException:
        if (hasattr(self, 'kvc') is True):
            self.kvc.close()
        raise KaresansuiGadgetException
    return True

dataset/ETHPy150Open karesansui/karesansui/karesansui/gadget/tree.py Tree._GET/original