Remove unused metadata conductor parameter
The metadata class no longer makes use of the conductor parameter. Just remove it from there and from calling methods. Change-Id: I19e4d383913b8dc1584fa70f264ff77141906c62
This commit is contained in:
@@ -99,7 +99,7 @@ class InstanceMetadata(object):
|
||||
"""Instance metadata."""
|
||||
|
||||
def __init__(self, instance, address=None, content=None, extra_md=None,
|
||||
conductor_api=None, network_info=None, vd_driver=None):
|
||||
network_info=None, vd_driver=None):
|
||||
"""Creation of this object should basically cover all time consuming
|
||||
collection. Methods after that should not cause time delays due to
|
||||
network operations or lengthy cpu operations.
|
||||
@@ -496,18 +496,16 @@ class VendorDataDriver(object):
|
||||
return self._data
|
||||
|
||||
|
||||
def get_metadata_by_address(conductor_api, address):
|
||||
def get_metadata_by_address(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'],
|
||||
return get_metadata_by_instance_id(fixed_ip['instance_uuid'],
|
||||
address,
|
||||
ctxt)
|
||||
|
||||
|
||||
def get_metadata_by_instance_id(conductor_api, instance_id, address,
|
||||
ctxt=None):
|
||||
def get_metadata_by_instance_id(instance_id, address, ctxt=None):
|
||||
ctxt = ctxt or context.get_admin_context()
|
||||
instance = objects.Instance.get_by_uuid(
|
||||
ctxt, instance_id, expected_attrs=['ec2_ids', 'flavor', 'info_cache'])
|
||||
|
||||
@@ -26,7 +26,6 @@ import webob.dec
|
||||
import webob.exc
|
||||
|
||||
from nova.api.metadata import base
|
||||
from nova import conductor
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.i18n import _LE
|
||||
@@ -72,7 +71,6 @@ class MetadataRequestHandler(wsgi.Application):
|
||||
|
||||
def __init__(self):
|
||||
self._cache = memorycache.get_client()
|
||||
self.conductor_api = conductor.API()
|
||||
|
||||
def get_metadata_by_remote_address(self, address):
|
||||
if not address:
|
||||
@@ -85,7 +83,7 @@ class MetadataRequestHandler(wsgi.Application):
|
||||
return data
|
||||
|
||||
try:
|
||||
data = base.get_metadata_by_address(self.conductor_api, address)
|
||||
data = base.get_metadata_by_address(address)
|
||||
except exception.NotFound:
|
||||
return None
|
||||
|
||||
@@ -102,8 +100,7 @@ class MetadataRequestHandler(wsgi.Application):
|
||||
return data
|
||||
|
||||
try:
|
||||
data = base.get_metadata_by_instance_id(self.conductor_api,
|
||||
instance_id, address)
|
||||
data = base.get_metadata_by_instance_id(instance_id, address)
|
||||
except exception.NotFound:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user