diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-08-01 18:59:29 +0000 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-08-01 18:59:29 +0000 |
| commit | 8e7a4e6147cb78b28fc2a2131591dbd37de2fa30 (patch) | |
| tree | 9ce06dbad2f46334761f6963ce7d5709b0c72712 | |
| parent | 1db6b5768a1160ee5e45ddadae7ba5c56b0abb4b (diff) | |
| download | nova-8e7a4e6147cb78b28fc2a2131591dbd37de2fa30.tar.gz nova-8e7a4e6147cb78b28fc2a2131591dbd37de2fa30.tar.xz nova-8e7a4e6147cb78b28fc2a2131591dbd37de2fa30.zip | |
Revert hasattr() check on 'set_auth_token' for clients
| -rw-r--r-- | nova/image/glance.py | 3 | ||||
| -rw-r--r-- | nova/virt/xenapi/vm_utils.py | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py index 588d86b6e..44a3c6f83 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -85,8 +85,7 @@ class GlanceImageService(service.BaseImageService): def _set_client_context(self, context): """Sets the client's auth token.""" - if hasattr(self.client, 'set_auth_token'): - self.client.set_auth_token(context.auth_token) + self.client.set_auth_token(context.auth_token) def index(self, context, filters=None, marker=None, limit=None): """Calls out to Glance for a list of images available.""" diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index c6320f917..6bbe6072c 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -465,8 +465,7 @@ class VMHelper(HelperBase): sr_ref = safe_find_sr(session) glance_client, image_id = nova.image.get_glance_client(image) - if hasattr(glance_client, 'set_auth_token'): - glance_client.set_auth_token(getattr(context, 'auth_token', None)) + glance_client.set_auth_token(getattr(context, 'auth_token', None)) meta, image_file = glance_client.get_image(image_id) virtual_size = int(meta['size']) vdi_size = virtual_size |
