def get_introspect(self): try: for ip in self.inputs.cfgm_ips: if vmware_introspect_utils.\ get_vcenter_plugin_introspect_elements(\ vmware_introspect_utils.VMWareInspect(ip)): self.vcntr_introspect = vmware_introspect_utils.VMWareInspect( ip) break except Exception as e: self.logger.exception(e)
self.vcntr_introspect, vrouter_ip) try: for virtual_machine in vrouter_details.virtual_machines: if virtual_machine.name == vm_name: self.logger.error("Vcenter plugin verification:%s STILL in vorouter %s in virtual network %s"\ %(vm_name,vrouter_ip,virtual_machine.virtual_network)) return False except Exception as e: self.logger.info("Vcenter plugin verification:%s deleted in vorouter %s "\ %(vm_name,vrouter_ip)) return True self.logger.info("Vcenter plugin verification:%s deleted in vorouter %s "\ %(vm_name,vrouter_ip)) return True if __name__ == '__main__': va = vmware_introspect_utils.VMWareInspect('10.204.216.14') class Inputs: def __init__(self): self.cfgm_ips = ['10.204.216.7', '10.204.216.14', '10.204.216.15'] r = vmware_introspect_utils.vrouter_details(va, '10.204.217.27') import pprint pprint.pprint(r) inputs = Inputs() vcenter = VMWareVerificationLib(inputs) vcenter.verify_vm_in_vcenter('10.204.217.27', 'test_vm2')
def get_introspect(self, vrouter): self.vcntr_introspect = vmware_introspect_utils.VMWareInspect(vrouter)