Skip to content

Instantly share code, notes, and snippets.

View vishvananda's full-sized avatar

Vish (Ishaya) Abrams vishvananda

  • Heroku
  • United States
View GitHub Profile
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py
index 92ef176..5f97e70 100644
--- a/nova/api/openstack/common.py
+++ b/nova/api/openstack/common.py
@@ -304,6 +304,11 @@ def get_networks_for_instance_from_nw_info(nw_info):
return networks
+def get_nwinfo_for_instance(context, instance):
+ cached_nwinfo = instance['info_cache'].get('network_info') or []
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 0accb91..5946750 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1983,10 +1983,6 @@ class ComputeManager(manager.SchedulerDependentManager):
# Releasing vlan.
# (not necessary in current implementation?)
- # NOTE(tr3buchet): tear down networks on source host
- self.network_api.setup_networks_on_host(ctxt, instance_ref,
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 0accb91..5cb34f8 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -2024,15 +2024,6 @@ class ComputeManager(manager.SchedulerDependentManager):
"args": {'instance_id': instance_ref['id'],
'block_migration': block_migration}})
- # Restore instance state
- current_power_state = self._get_power_state(ctxt, instance_ref)
diff --git a/etc/nova/api-paste.ini b/etc/nova/api-paste.ini
index 0baa85d..45d3f7f 100644
--- a/etc/nova/api-paste.ini
+++ b/etc/nova/api-paste.ini
@@ -36,9 +36,9 @@ use = egg:Paste#urlmap
[composite:ec2cloud]
use = call:nova.api.auth:pipeline_factory
-noauth = ec2faultwrap logrequest ec2noauth cloudrequest authorizer validator ec2executor
+noauth = ec2faultwrap logrequest ec2noauth cloudrequest validator ec2executor
diff --git a/nova/testing/fake/memcache.py b/nova/testing/fake/memcache.py
index e4f238a..6677ed3 100644
--- a/nova/testing/fake/memcache.py
+++ b/nova/testing/fake/memcache.py
@@ -30,10 +30,11 @@ class Client(object):
def get(self, key):
"""Retrieves the value for a key or None."""
- (timeout, value) = self.cache.get(key, (0, None))
- if timeout == 0 or utils.utcnow_ts() < timeout:
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
index b292c93..889488c 100644
--- a/nova/virt/libvirt/connection.py
+++ b/nova/virt/libvirt/connection.py
@@ -2018,13 +2018,13 @@ class LibvirtConnection(driver.ComputeDriver):
# if image has kernel and ramdisk, just download
# following normal way.
if instance_ref['kernel_id']:
- libvirt_utils.fetch_image(nova_context.get_admin_context(),
+ libvirt_utils.fetch_image(ctxt,
diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py
index c1c85c6..aef578f 100644
--- a/nova/api/openstack/compute/contrib/extended_server_attributes.py
+++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py
@@ -69,7 +69,7 @@ class ExtendedServerAttributesController(wsgi.Controller):
context = req.environ['nova.context']
if authorize(context):
# Attach our slave template to the response object
- resp_obj.attach(xml=ExtendedServerAttributesTemplate())
+ resp_obj.attach(xml=ExtendedServerAttributeTemplate())
diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py
index c1c85c6..a4794d7 100644
--- a/nova/api/openstack/compute/contrib/extended_server_attributes.py
+++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py
@@ -69,7 +69,7 @@ class ExtendedServerAttributesController(wsgi.Controller):
context = req.environ['nova.context']
if authorize(context):
# Attach our slave template to the response object
- resp_obj.attach(xml=ExtendedServerAttributesTemplate())
+ resp_obj.attach(xml=ExtendedServerAttributeTemplate())
diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py
index c1c85c6..a4794d7 100644
--- a/nova/api/openstack/compute/contrib/extended_server_attributes.py
+++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py
@@ -69,7 +69,7 @@ class ExtendedServerAttributesController(wsgi.Controller):
context = req.environ['nova.context']
if authorize(context):
# Attach our slave template to the response object
- resp_obj.attach(xml=ExtendedServerAttributesTemplate())
+ resp_obj.attach(xml=ExtendedServerAttributeTemplate())
diff --git a/nova/testing/fake/__init__.py b/nova/testing/fake/__init__.py
index d9eebbd..5cdad47 100644
--- a/nova/testing/fake/__init__.py
+++ b/nova/testing/fake/__init__.py
@@ -1,2 +1 @@
-import memcache
import rabbit