Glance RegistryClient only connects to 0.0.0.0:9292

Bug #704038 reported by Jay Pipes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Jay Pipes

Bug Description

Glance RegistryClient is only instantiated with no arguments, meaning that the glance registry server must be running on 0.0.0.0:9292 for the code in /glance/registry/__init__.py to work, which has hard-coded 0.0.0.0 as it's host param:

# vim: tabstop=4 shiftwidth=4 softtabstop=4

# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

"""
Registry API
"""

from glance.registry import client

def get_images_list():
    c = client.RegistryClient("0.0.0.0")
    return c.get_images()

def get_images_detail():
    c = client.RegistryClient("0.0.0.0")
    return c.get_images_detailed()

def get_image_metadata(image_id):
    c = client.RegistryClient("0.0.0.0")
    return c.get_image(image_id)

def add_image_metadata(image_data):
    c = client.RegistryClient("0.0.0.0")
    return c.add_image(image_data)

def update_image_metadata(image_id, image_data):
    c = client.RegistryClient("0.0.0.0")
    return c.update_image(image_id, image_data)

def delete_image_metadata(image_id):
    c = client.RegistryClient("0.0.0.0")
    return c.delete_image(image_id)

Solution:

Create a flag value 'registry_server_host' and 'registry_server_port' and use the flag values

Related branches

Jay Pipes (jaypipes)
Changed in glance:
status: New → Confirmed
importance: Undecided → High
Jay Pipes (jaypipes)
Changed in glance:
status: Confirmed → Triaged
status: Triaged → In Progress
assignee: nobody → Jay Pipes (jaypipes)
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → 0.1.7
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.