diff options
author | Mark McLoughlin <markmc@redhat.com> | 2013-01-08 07:54:01 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2013-01-09 08:15:43 +0000 |
commit | 44cc0cda04cd20adf057eff76af0e6ba5ee0dcad (patch) | |
tree | 799b398b10bbb1a08545bb4a8cde7a8a680e2dfd | |
parent | 2803fd8d400b7d76138b2e2c152017a3d5e49685 (diff) | |
download | nova-44cc0cda04cd20adf057eff76af0e6ba5ee0dcad.tar.gz nova-44cc0cda04cd20adf057eff76af0e6ba5ee0dcad.tar.xz nova-44cc0cda04cd20adf057eff76af0e6ba5ee0dcad.zip |
Move default_instance_type into nova.compute
Apart from the tests, this option is only used in
nova.compute.instance_types so move it there.
blueprint: scope-config-opts
Change-Id: Iadf4011739e50455b7ad4214a778a02e244fef35
-rw-r--r-- | nova/compute/instance_types.py | 9 | ||||
-rw-r--r-- | nova/config.py | 3 | ||||
-rw-r--r-- | nova/tests/api/ec2/test_cinder_cloud.py | 2 | ||||
-rw-r--r-- | nova/tests/api/ec2/test_cloud.py | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index 6c4e9293c..a0819416c 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -30,8 +30,15 @@ from nova.openstack.common import cfg from nova.openstack.common import log as logging from nova import utils +instance_type_opts = [ + cfg.StrOpt('default_instance_type', + default='m1.small', + help='default instance type to use, testing only'), +] + CONF = cfg.CONF -CONF.import_opt('default_instance_type', 'nova.config') +CONF.register_opts(instance_type_opts) + LOG = logging.getLogger(__name__) INVALID_NAME_REGEX = re.compile("[^\w\.\- ]") diff --git a/nova/config.py b/nova/config.py index 320e2e9bc..95d897255 100644 --- a/nova/config.py +++ b/nova/config.py @@ -50,9 +50,6 @@ global_opts = [ cfg.ListOpt('enabled_apis', default=['ec2', 'osapi_compute', 'metadata'], help='a list of APIs to enable by default'), - cfg.StrOpt('default_instance_type', - default='m1.small', - help='default instance type to use, testing only'), cfg.StrOpt('vpn_image_id', default='0', help='image id used when starting up a cloudpipe vpn server'), diff --git a/nova/tests/api/ec2/test_cinder_cloud.py b/nova/tests/api/ec2/test_cinder_cloud.py index c333def6c..8d36debd2 100644 --- a/nova/tests/api/ec2/test_cinder_cloud.py +++ b/nova/tests/api/ec2/test_cinder_cloud.py @@ -39,7 +39,7 @@ from nova import volume CONF = cfg.CONF CONF.import_opt('compute_driver', 'nova.virt.driver') -CONF.import_opt('default_instance_type', 'nova.config') +CONF.import_opt('default_instance_type', 'nova.compute.instance_types') CONF.import_opt('use_ipv6', 'nova.config') LOG = logging.getLogger(__name__) diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py index e0470689a..1d8dad1e8 100644 --- a/nova/tests/api/ec2/test_cloud.py +++ b/nova/tests/api/ec2/test_cloud.py @@ -52,7 +52,7 @@ from nova import volume CONF = cfg.CONF CONF.import_opt('compute_driver', 'nova.virt.driver') -CONF.import_opt('default_instance_type', 'nova.config') +CONF.import_opt('default_instance_type', 'nova.compute.instance_types') CONF.import_opt('use_ipv6', 'nova.config') LOG = logging.getLogger(__name__) |