summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-01-07 22:06:49 +0000
committerMark McLoughlin <markmc@redhat.com>2013-01-08 10:23:40 +0000
commit2bcca3959209707e5604948ceb70d039671ae002 (patch)
treef1d3df4e8a24333251808c1fdd11f4865ba4273a /nova/utils.py
parent942b3ed874f045c892ad497ffadfdd80cb63bf9e (diff)
downloadnova-2bcca3959209707e5604948ceb70d039671ae002.tar.gz
nova-2bcca3959209707e5604948ceb70d039671ae002.tar.xz
nova-2bcca3959209707e5604948ceb70d039671ae002.zip
Move global glance opts into nova.image.glance
Move the glance_host, glance_port and glance_protocol options into the nova.image.glance module. Also move the generate_glance_url() and generate_image_url() utility methods there since they're the only uses of the options outside of the module. blueprint: scope-config-opts Change-Id: I3beca1a65cdd902a94ddc1c512d79a4de635ef38
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 1056a6e2d..57b2a625f 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -80,9 +80,6 @@ utils_opts = [
CONF = cfg.CONF
CONF.register_opts(monkey_patch_opts)
CONF.register_opts(utils_opts)
-CONF.import_opt('glance_host', 'nova.config')
-CONF.import_opt('glance_port', 'nova.config')
-CONF.import_opt('glance_protocol', 'nova.config')
CONF.import_opt('service_down_time', 'nova.config')
LOG = logging.getLogger(__name__)
@@ -975,17 +972,6 @@ def timefunc(func):
return inner
-def generate_glance_url():
- """Generate the URL to glance."""
- return "%s://%s:%d" % (CONF.glance_protocol, CONF.glance_host,
- CONF.glance_port)
-
-
-def generate_image_url(image_ref):
- """Generate an image URL from an image_ref."""
- return "%s/images/%s" % (generate_glance_url(), image_ref)
-
-
@contextlib.contextmanager
def remove_path_on_error(path):
"""Protect code that wants to operate on PATH atomically.