def collection_appliance(self): # if parallelized, this is decided in sessionstart and written to the conf if store.parallelizer_role == 'slave': from cfme.utils.appliance import IPAppliance return IPAppliance.from_url(conf['.ui-coverage']['collection_appliance']) else: # otherwise, coverage only happens on one appliance return store.current_appliance
def collection_appliance(self): # if parallelized, this is decided in sessionstart and written to the conf if store.parallelizer_role == 'slave': from cfme.utils.appliance import IPAppliance return IPAppliance.from_url(conf['.ui-coverage']['collection_appliance']) else: # otherwise, coverage only happens on one appliance return store.current_appliance
def test_context_hack(monkeypatch): ip_a = IPAppliance.from_url('http://127.0.0.2/') def not_good(*k): raise RuntimeError() monkeypatch.setattr(ip_a, '_screenshot_capture_at_context_leave', not_good) with pytest.raises(ValueError): with ip_a: raise ValueError("test")
def test_context_hack(monkeypatch): ip_a = IPAppliance.from_url('http://127.0.0.2/') def not_good(*k): raise RuntimeError() monkeypatch.setattr(ip_a, '_screenshot_capture_at_context_leave', not_good) with pytest.raises(ValueError): with ip_a: raise ValueError("test")
def main(): parser = argparse.ArgumentParser(epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('url', help='URL of target appliance, e.g. "https://ip_or_host/"') parser.add_argument('--num-sec', default=600, type=int, dest='num_sec', help='Maximum number of seconds to wait before giving up, default 600 (10 minutes)') args = parser.parse_args() ip_a = IPAppliance.from_url(args.url) result = ip_a.wait_for_web_ui(timeout=args.num_sec) if not result: return 1
def main(): parser = argparse.ArgumentParser( epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('hostname', nargs='?', default=None, help='hostname or ip address of target appliance') parser.add_argument('start', action="store_true", default=False, help='Start Merkyl?') args = parser.parse_args() if args.hostname is not None: ip_a = IPAppliance(args.hostname) else: ip_a = IPAppliance.from_url() ip_a.deploy_merkyl(args.start)
def test_ipappliance_from_url(): address = '1.2.3.4' url = 'http://{}/'.format(address) ip_a = IPAppliance.from_url(url) assert ip_a.url == url assert ip_a.address == address
def test_ipappliance_from_url(): address = '1.2.3.4' url = 'http://{}/'.format(address) ip_a = IPAppliance.from_url(url) assert ip_a.url == url assert ip_a.hostname == address
def test_ipappliance_from_url(): address = '1.2.3.4' url = f'http://{address}/' ip_a = IPAppliance.from_url(url) assert ip_a.url == url assert ip_a.hostname == address