diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-01-23 11:51:14 +0000 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-01-28 12:37:16 +0000 |
| commit | 82049af90e86380043c59741fa4e1cd2cf24aaa7 (patch) | |
| tree | fd5a35b7a373de888ece003929f8c499b34ce83c /nova/image | |
| parent | 02b872625b94c3c63674d8c64b23f80215b04a15 (diff) | |
| download | nova-82049af90e86380043c59741fa4e1cd2cf24aaa7.tar.gz nova-82049af90e86380043c59741fa4e1cd2cf24aaa7.tar.xz nova-82049af90e86380043c59741fa4e1cd2cf24aaa7.zip | |
Refactor away the flags.DEFINE_* helpers
The next obvious step in porting to cfg is to define all options using
cfg schemas directly rather than using the flags.DEFINE_* helpers.
This is a large change, but it is almost entirely pure refactoring and
does not result in any functional changes.
The only change to note is that the default values for glance_host,
glance_api_servers and default_publisher_id options are now using opt
value interpolation i.e.
-glance_host=_get_my_ip()
+glance_host='$my_ip'
-glance_api_servers=['%s:%d' % (FLAGS.glance_host, FLAGS.glance_port)]
+glance_api_servers=['$glance_host:$glance_port']
-default_publisher_id=FLAGS.host
+default_publisher_id='$host'
Also note that the lower_bound check on the {report,periodic}_interval
options are no more, but this has been true since cfg was first added.
Change-Id: Ia58c8f0aaf61628bb55b1b8485118a2a9852ed17
Diffstat (limited to 'nova/image')
| -rw-r--r-- | nova/image/s3.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/nova/image/s3.py b/nova/image/s3.py index e73364a42..ee11c163c 100644 --- a/nova/image/s3.py +++ b/nova/image/s3.py @@ -31,6 +31,7 @@ import eventlet from nova import rpc import nova.db.api +from nova.common import cfg from nova import exception from nova import flags from nova import image @@ -40,13 +41,21 @@ from nova.api.ec2 import ec2utils LOG = logging.getLogger("nova.image.s3") + +s3_opts = [ + cfg.StrOpt('image_decryption_dir', + default='/tmp', + help='parent dir for tempdir used for image decryption'), + cfg.StrOpt('s3_access_key', + default='notchecked', + help='access key to use for s3 server for images'), + cfg.StrOpt('s3_secret_key', + default='notchecked', + help='secret key to use for s3 server for images'), + ] + FLAGS = flags.FLAGS -flags.DEFINE_string('image_decryption_dir', '/tmp', - 'parent dir for tempdir used for image decryption') -flags.DEFINE_string('s3_access_key', 'notchecked', - 'access key to use for s3 server for images') -flags.DEFINE_string('s3_secret_key', 'notchecked', - 'secret key to use for s3 server for images') +FLAGS.add_options(s3_opts) class S3ImageService(object): |
