def SpecifyDetails(self, vm): config = vm.get_config() if config: dlg = ApplianceDetailsDlg() ret = dlg.show(config, self.defaults) else: raise Exception("VM config not found.")
def get_info(self, vm, username=None, password=None): if vm and vm.get_config(): config = vm.get_config() for vkey in ("host", "app_protocol", "app_port", "app_path", "app_mgmt_protocol", "app_mgmt_port"): if not config.get(vkey): dlg = ApplianceDetailsDlg() ret = dlg.show(config, self.defaults) break host = config["host"] if not host: raise Exception("Appliance host not specified") proto = config["app_mgmt_protocol"] if not proto: raise Exception("Appliance management protocol not specified") if config["app_mgmt_port"]: port = int(config["app_mgmt_port"]) else: raise Exception("Invalid appliance management port") app_proto = config["app_protocol"] if config["app_port"]: app_port = int(config["app_port"]) else: raise Exception("Invalid appliance port") if config["app_path"]: app_path = config["app_path"] else: app_path = "/" # TBD : credential management needs to be done properly if username is None: username = "******" if password is None: password = "******" return ((app_proto, host, app_port, app_path), (proto, host, port), (username, password))