diff --git a/neutron/neutron/services/l3_router/aws_router_plugin.py b/neutron/neutron/services/l3_router/aws_router_plugin.py index d7a3408..9abfd47 100644 --- a/neutron/neutron/services/l3_router/aws_router_plugin.py +++ b/neutron/neutron/services/l3_router/aws_router_plugin.py @@ -69,7 +69,6 @@ class AwsRouterPlugin( def __init__(self): self.aws_utils = AwsUtils() super(AwsRouterPlugin, self).__init__() - l3_db.subscribe() def get_plugin_type(self): return plugin_type diff --git a/neutron/neutron/services/l3_router/azure_router_plugin.py b/neutron/neutron/services/l3_router/azure_router_plugin.py index 5bd38ab..b45a35a 100644 --- a/neutron/neutron/services/l3_router/azure_router_plugin.py +++ b/neutron/neutron/services/l3_router/azure_router_plugin.py @@ -67,7 +67,6 @@ class AzureRouterPlugin( @resource_registry.tracked_resources(router=router, floatingip=floating_ip) def __init__(self): super(AzureRouterPlugin, self).__init__() - l3_db.subscribe() self._compute_client = None self._network_client = None self.tenant_id = azure_conf.tenant_id diff --git a/neutron/neutron/services/l3_router/gce_router_plugin.py b/neutron/neutron/services/l3_router/gce_router_plugin.py index f49358d..8af9ab5 100644 --- a/neutron/neutron/services/l3_router/gce_router_plugin.py +++ b/neutron/neutron/services/l3_router/gce_router_plugin.py @@ -70,7 +70,6 @@ class GceRouterPlugin( floatingip=floating_ip) def __init__(self): super(GceRouterPlugin, self).__init__() - l3_db.subscribe() self.gce_zone = gceconf.zone self.gce_region = gceconf.region self.gce_project = gceconf.project_id diff --git a/nova/tests/unit/virt/ec2/test_ec2.py b/nova/tests/unit/virt/ec2/test_ec2.py index 3e46e27..081cbbf 100644 --- a/nova/tests/unit/virt/ec2/test_ec2.py +++ b/nova/tests/unit/virt/ec2/test_ec2.py @@ -535,7 +535,6 @@ class EC2DriverTestCase(test.NoDBTestCase): self._create_vm_in_aws_nova() vm_info = self.conn.get_info(self.instance) self.assertEqual(0, vm_info.state) - self.assertEqual(self.instance.id, vm_info.id) self.reset() @mock_ec2_deprecated diff --git a/nova/virt/azure/driver.py b/nova/virt/azure/driver.py index 02c2d64..f54400d 100644 --- a/nova/virt/azure/driver.py +++ b/nova/virt/azure/driver.py @@ -542,31 +542,11 @@ class AzureDriver(driver.ComputeDriver): return state def get_info(self, instance): - """Get the current status of an instance, by name (not ID!) - - :param instance: nova.objects.instance.Instance object - Returns a dict containing: - :state: the running state, one of the power_state codes - :max_mem: (int) the maximum memory in KBytes allowed - :mem: (int) the memory in KBytes used by the domain - :num_cpu: (int) the number of virtual CPUs for the domain - :cpu_time: (int) the CPU time used in nanoseconds - """ - azure_name = self._get_omni_name_from_instance(instance) azure_instance = utils.get_instance( self.compute_client, drv_conf.resource_group, azure_name) state = self._get_power_state(azure_instance) - flavor = self.flavor_info[instance.flavor.name] - memory = flavor.memory_in_mb * 1024 - cpus = flavor.number_of_cores - return hardware.InstanceInfo( - state=state, - max_mem_kb=memory, - mem_kb=memory, - num_cpu=cpus, - cpu_time_ns=0, - id=instance.id) + return hardware.InstanceInfo(state=state) def allow_key(self, key): DIAGNOSTIC_KEYS_TO_FILTER = ['group', 'block_device_mapping'] diff --git a/nova/virt/ec2/ec2driver.py b/nova/virt/ec2/ec2driver.py index 50a26a3..31c6150 100644 --- a/nova/virt/ec2/ec2driver.py +++ b/nova/virt/ec2/ec2driver.py @@ -707,17 +707,6 @@ class EC2Driver(driver.ComputeDriver): raise exception.InterfaceDetachFailed('not attached') def get_info(self, instance): - """Get the current status of an instance, by name (not ID!) - - :param instance: nova.objects.instance.Instance object - Returns a dict containing: - :state: the running state, one of the power_state codes - :max_mem: (int) the maximum memory in KBytes allowed - :mem: (int) the memory in KBytes used by the domain - :num_cpu: (int) the number of virtual CPUs for the domain - :cpu_time: (int) the CPU time used in nanoseconds - """ - if instance.uuid in self._uuid_to_ec2_instance: ec2_instance = self._uuid_to_ec2_instance[instance.uuid] elif 'metadata' in instance and 'ec2_id' in instance['metadata']: @@ -734,13 +723,7 @@ class EC2Driver(driver.ComputeDriver): raise exception.InstanceNotFound(instance_id=instance['name']) power_state = EC2_STATE_MAP.get(ec2_instance.state) - ec2_flavor = self.ec2_flavor_info.get(ec2_instance.instance_type) - memory_mb = ec2_flavor['memory_mb'] - vcpus = ec2_flavor['vcpus'] - - return hardware.InstanceInfo(state=power_state, max_mem_kb=memory_mb, - mem_kb=memory_mb, num_cpu=vcpus, - cpu_time_ns=0, id=instance.id) + return hardware.InstanceInfo(state=power_state) def allow_key(self, key): for key_to_filter in DIAGNOSTIC_KEYS_TO_FILTER: diff --git a/nova/virt/gce/driver.py b/nova/virt/gce/driver.py index 3cdbd15..c0eabc4 100644 --- a/nova/virt/gce/driver.py +++ b/nova/virt/gce/driver.py @@ -641,29 +641,11 @@ class GCEDriver(driver.ComputeDriver): raise NotImplementedError() def get_info(self, instance): - """Get the current status of an instance, by name (not ID!) - - :param instance: nova.objects.instance.Instance object - Returns a dict containing: - :state: the running state, one of the power_state codes - :max_mem: (int) the maximum memory in KBytes allowed - :mem: (int) the memory in KBytes used by the domain - :num_cpu: (int) the number of virtual CPUs for the domain - :cpu_time: (int) the CPU time used in nanoseconds - """ compute, project, zone = self.gce_svc, self.gce_project, self.gce_zone gce_id = self._get_gce_id_from_instance(instance) gce_instance = gceutils.get_instance(compute, project, zone, gce_id) power_state = GCE_STATE_MAP[gce_instance['status']] - - gce_flavor = self.gce_flavor_info[instance.flavor.name] - memory_mb = gce_flavor['memory_mb'] - vcpus = gce_flavor['vcpus'] - - return hardware.InstanceInfo(state=power_state, - max_mem_kb=memory_mb * 1024, - mem_kb=memory_mb * 1024, num_cpu=vcpus, - cpu_time_ns=0, id=instance.id) + return hardware.InstanceInfo(state=power_state) def allow_key(self, key): if key in DIAGNOSTIC_KEYS_TO_FILTER: