Skip to content

Commit

Permalink
Adding admin_token to image-cache config.
Browse files Browse the repository at this point in the history
Fixes bug 888802

Change-Id: If1fa7c4a6ba09b86ddba0ceff9a922aa6a9d27af
  • Loading branch information
rconradharris committed Nov 10, 2011
1 parent 5885b61 commit 0a39470
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions etc/glance-cache.conf
Expand Up @@ -36,6 +36,9 @@ registry_host = 0.0.0.0
# Port the registry server is listening on
registry_port = 9191

# Admin token to use if using Keystone
# admin_token = 123

[app:glance-pruner]
paste.app_factory = glance.image_cache.pruner:app_factory

Expand Down
4 changes: 3 additions & 1 deletion glance/image_cache/prefetcher.py
Expand Up @@ -42,7 +42,9 @@ def __init__(self, options):
registry.configure_registry_client(options)

def fetch_image_into_cache(self, image_id):
ctx = context.RequestContext(is_admin=True, show_deleted=True)
auth_tok = self.options.get('admin_token')
ctx = context.RequestContext(is_admin=True, show_deleted=True,
auth_tok=auth_tok)
try:
image_meta = registry.get_image_metadata(ctx, image_id)
if image_meta['status'] != 'active':
Expand Down
4 changes: 3 additions & 1 deletion glance/image_cache/queue_image.py
Expand Up @@ -41,7 +41,9 @@ def __init__(self, options):
registry.configure_registry_client(options)

def queue_image(self, image_id):
ctx = context.RequestContext(is_admin=True, show_deleted=True)
auth_tok = self.options.get('admin_token')
ctx = context.RequestContext(is_admin=True, show_deleted=True,
auth_tok=auth_tok)
try:
image_meta = registry.get_image_metadata(ctx, image_id)
if image_meta['status'] != 'active':
Expand Down

0 comments on commit 0a39470

Please sign in to comment.