Skip to content

Commit

Permalink
Fix typo of conf variable in config.py
Browse files Browse the repository at this point in the history
Fixes bug 1015270

Change-Id: I1cedcb3095f56225920c7482b16cc597b0572a4a
  • Loading branch information
ameade committed Jun 19, 2012
1 parent ee640fc commit 9a7946a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion glance/common/config.py
Expand Up @@ -144,7 +144,7 @@ def _get_deployment_config_file(default_paste_file=None):
if not path:
path = _get_paste_config_path(default_paste_file)
if not path:
msg = "Unable to locate paste config file for %s." % conf.prog
msg = "Unable to locate paste config file for %s." % CONF.prog
raise RuntimeError(msg)
return os.path.abspath(path)

Expand Down
9 changes: 7 additions & 2 deletions glance/tests/unit/test_config.py
Expand Up @@ -24,7 +24,6 @@
from glance.common import config
from glance.common import context
from glance.image_cache import pruner
from glance.openstack.common import cfg
from glance.tests import utils as test_utils


Expand All @@ -40,6 +39,7 @@ def tearDown(self):

def _do_test_load_paste_app(self,
expected_app_type,
make_paste_file=True,
paste_flavor=None,
paste_config_file=None,
paste_append=None):
Expand Down Expand Up @@ -67,7 +67,7 @@ def _appendto(orig, copy, str):
config.parse_args(['--config-file', temp_file])

paste_to = temp_file.replace('.conf', '-paste.ini')
if not paste_config_file:
if not paste_config_file and make_paste_file:
paste_from = os.path.join(os.getcwd(),
'etc/glance-registry-paste.ini')
_appendto(paste_from, paste_to, paste_append)
Expand All @@ -82,6 +82,11 @@ def test_load_paste_app(self):
expected_middleware = context.UnauthenticatedContextMiddleware
self._do_test_load_paste_app(expected_middleware)

def test_load_paste_app_paste_config_not_found(self):
expected_middleware = context.UnauthenticatedContextMiddleware
self.assertRaises(RuntimeError, self._do_test_load_paste_app,
expected_middleware, make_paste_file=False)

def test_load_paste_app_with_paste_flavor(self):
pipeline = ('[pipeline:glance-registry-incomplete]\n'
'pipeline = context registryapp')
Expand Down

0 comments on commit 9a7946a

Please sign in to comment.