From 0778420dcd94b935d7c6dd075e49041e497cf462 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 8 Jan 2013 06:37:20 +0000 Subject: Move global s3 opts into nova.image.s3 s3_host and s3_port are only used in nova.image.s3. blueprint: scope-config-opts Change-Id: Ia841406ebe7c03b2a58392e2453118e2646ad7ce --- nova/config.py | 7 ------- nova/image/s3.py | 10 ++++++++-- nova/tests/test_objectstore.py | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/nova/config.py b/nova/config.py index f87dbfdd3..6b0ea60d6 100644 --- a/nova/config.py +++ b/nova/config.py @@ -47,13 +47,6 @@ global_opts = [ cfg.StrOpt('my_ip', default=_get_my_ip(), help='ip address of this host'), - cfg.IntOpt('s3_port', - default=3333, - help='port used when accessing the s3 api'), - cfg.StrOpt('s3_host', - default='$my_ip', - help='hostname or ip for openstack to use when accessing ' - 'the s3 api'), cfg.StrOpt('cert_topic', default='cert', help='the topic cert nodes listen on'), diff --git a/nova/image/s3.py b/nova/image/s3.py index b5bb3436e..6cb5e74ac 100644 --- a/nova/image/s3.py +++ b/nova/image/s3.py @@ -44,6 +44,13 @@ s3_opts = [ cfg.StrOpt('image_decryption_dir', default='/tmp', help='parent dir for tempdir used for image decryption'), + cfg.StrOpt('s3_host', + default='$my_ip', + help='hostname or ip for openstack to use when accessing ' + 'the s3 api'), + cfg.IntOpt('s3_port', + default=3333, + help='port used when accessing the s3 api'), cfg.StrOpt('s3_access_key', default='notchecked', help='access key to use for s3 server for images'), @@ -61,8 +68,7 @@ s3_opts = [ CONF = cfg.CONF CONF.register_opts(s3_opts) -CONF.import_opt('s3_host', 'nova.config') -CONF.import_opt('s3_port', 'nova.config') +CONF.import_opt('my_ip', 'nova.config') class S3ImageService(object): diff --git a/nova/tests/test_objectstore.py b/nova/tests/test_objectstore.py index 8885b3554..e76a31ee2 100644 --- a/nova/tests/test_objectstore.py +++ b/nova/tests/test_objectstore.py @@ -34,7 +34,7 @@ from nova import test from nova import wsgi CONF = cfg.CONF -CONF.import_opt('s3_host', 'nova.config') +CONF.import_opt('s3_host', 'nova.image.s3') # Create a unique temporary directory. We don't delete after test to # allow checking the contents after running tests. Users and/or tools -- cgit