From 8e7a4e6147cb78b28fc2a2131591dbd37de2fa30 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Mon, 1 Aug 2011 18:59:29 +0000 Subject: Revert hasattr() check on 'set_auth_token' for clients --- nova/image/glance.py | 3 +-- 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 -- cgit