def make_proxies(self, options=None): """Create a Proxy""" proxy1 = make_proxy(options=options) proxy2 = make_proxy(options=options) yield dict(proxy1=proxy1, proxy2=proxy2) capsule_cleanup(proxy1['id']) capsule_cleanup(proxy2['id'])
def module_fake_proxy(request, default_sat): """Create a Proxy and register the cleanup function""" args = {'name': gen_string(str_type='alpha')} newport = get_available_capsule_port() try: with default_url_on_new_port(9090, newport) as url: args['url'] = url proxy = default_sat.api.SmartProxy(**args).create() yield proxy capsule_cleanup(proxy.id) except CapsuleTunnelError as err: pytest.fail(f'Failed to create ssh tunnel: {err}')
def proxy(): """Create a Proxy and clean up when done.""" proxy = make_proxy() yield proxy capsule_cleanup(proxy_id=proxy['id'])
def _cleanup(): capsule_cleanup(proxy['id'])
def _cleanup(): HostGroup.delete({'id': hostgroup['id']}) capsule_cleanup(new_content_source['id'])
def _cleanup(): with session_puppet_enabled_sat: HostGroup.delete({'id': hostgroup['id']}) capsule_cleanup(new_content_source['id'])
def _make_proxy(options=None): """Create a Proxy and register the cleanup function""" proxy = make_proxy(options=options) yield proxy capsule_cleanup(proxy['id'])
def _cleanup(): capsule_cleanup(proxy.id)
def _make_proxy(request): """Create a Proxy and register the cleanup function""" proxy = make_proxy() request.addfinalizer(lambda: capsule_cleanup(proxy['id'])) return proxy