def test_skip_policy(self): policy.reset() rules = {'network:get_all': common_policy.parse_rule('!')} policy.set_rules(common_policy.Rules(rules)) api = network.API() self.assertRaises(exception.PolicyNotAuthorized, api.get_all, self.context) api = network.API(skip_policy_check=True) api.get_all(self.context)
def network_api(self): # NOTE(danms): We need to instantiate our network_api on first use # to avoid the circular dependency that exists between our init # and network_api's if self._network_api is None: self._network_api = network.API() return self._network_api
def get_metadata_by_address(conductor_api, address): ctxt = context.get_admin_context() fixed_ip = network.API().get_fixed_ip_by_address(ctxt, address) return get_metadata_by_instance_id(conductor_api, fixed_ip['instance_uuid'], address, ctxt)
def _get_nwinfo_old_skool(): """Support for getting network info without objects.""" if (instance_ref.get('info_cache') and instance_ref['info_cache'].get('network_info') is not None): cached_info = instance_ref['info_cache']['network_info'] if isinstance(cached_info, network_model.NetworkInfo): return cached_info return network_model.NetworkInfo.hydrate(cached_info) try: return network.API().get_instance_nw_info(admin_context, instance_ref) except Exception: try: with excutils.save_and_reraise_exception(): LOG.exception(_LE('Failed to get nw_info'), instance=instance_ref) except Exception: if ignore_missing_network_data: return raise
def __init__(self, network_api=None): self.network_api = network_api or network.API()
def __init__(self, network_api=None): self.network_api = network_api or network.API(skip_policy_check=True)
def __init__(self): self.compute_api = compute.API(skip_policy_check=True) self.network_api = network.API(skip_policy_check=True) self.cloudpipe = pipelib.CloudPipe(skip_policy_check=True) self.setup()
def setUp(self): super(ApiTestCase, self).setUp() self.network_api = network.API() self.context = context.RequestContext('fake-user', 'fake-project')
def __init__(self): self.network_api = network.API() self.cert_rpcapi = patron.cert.rpcapi.CertAPI() super(CertificatesController, self).__init__()
def __init__(self): self.compute_api = compute.API() self.network_api = network.API() self.cloudpipe = pipelib.CloudPipe() self.setup()
def __init__(self): self.compute_api = compute.API(skip_policy_check=True) self.network_api = network.API(skip_policy_check=True) super(FloatingIPController, self).__init__()
def __init__(self): super(FloatingIPDNSDomainController, self).__init__() self.network_api = network.API(skip_policy_check=True)
def __init__(self, ext_mgr=None, *args, **kwargs): super(FloatingIPActionController, self).__init__(*args, **kwargs) self.compute_api = compute.API() self.network_api = network.API() self.ext_mgr = ext_mgr
def __init__(self): self.compute_api = compute.API(skip_policy_check=True) self.network_api = network.API(skip_policy_check=True) super(ServerVirtualInterfaceController, self).__init__()
def __init__(self, network_api=None, ext_mgr=None): self.network_api = network_api or network.API() if ext_mgr: self.extended = ext_mgr.is_loaded('os-extended-networks') else: self.extended = False
def __init__(self): self.compute_api = compute.API() self.network_api = network.API() super(InterfaceAttachmentController, self).__init__()
def __init__(self): self.compute_api = compute.API() self.network_api = network.API() super(ServerVirtualInterfaceController, self).__init__()
def __init__(self): super(ExtendedServerVIFNetController, self).__init__() self.network_api = network.API()
def __init__(self): self.network_api = network.API() super(FloatingIPPoolsController, self).__init__()
def __init__(self, *args, **kwargs): super(FloatingIPActionController, self).__init__(*args, **kwargs) self.compute_api = compute.API(skip_policy_check=True) self.network_api = network.API(skip_policy_check=True)
def __init__(self, ext_mgr): self.network_api = network.API() super(Floating_ip_dns, self).__init__(ext_mgr)
def __init__(self): self.compute_api = compute.API() self.network_api = network.API() super(FloatingIPController, self).__init__()
def __init__(self): self.network_api = network.API() super(FloatingIPDNSDomainController, self).__init__()