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/flags.py | |
| 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/flags.py')
| -rw-r--r-- | nova/flags.py | 618 |
1 files changed, 347 insertions, 271 deletions
diff --git a/nova/flags.py b/nova/flags.py index 59c44470a..146817272 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -151,7 +151,7 @@ class FlagValues(object): ret[opt.dest] = getattr(self, opt.dest) return ret - def _add_option(self, opt): + def add_option(self, opt): if opt.dest in self._opts: return @@ -164,57 +164,14 @@ class FlagValues(object): self._conf.register_cli_opts(self._opts.values()) self._extra = None - def define_string(self, name, default, help): - self._add_option(cfg.StrOpt(name, default=default, help=help)) - - def define_integer(self, name, default, help): - self._add_option(cfg.IntOpt(name, default=default, help=help)) - - def define_float(self, name, default, help): - self._add_option(cfg.FloatOpt(name, default=default, help=help)) - - def define_bool(self, name, default, help): - self._add_option(cfg.BoolOpt(name, default=default, help=help)) - - def define_list(self, name, default, help): - self._add_option(cfg.ListOpt(name, default=default, help=help)) - - def define_multistring(self, name, default, help): - self._add_option(cfg.MultiStrOpt(name, default=default, help=help)) + def add_options(self, opts): + for opt in opts: + self.add_option(opt) FLAGS = FlagValues() -def DEFINE_string(name, default, help, flag_values=FLAGS): - flag_values.define_string(name, default, help) - - -def DEFINE_integer(name, default, help, lower_bound=None, flag_values=FLAGS): - # FIXME(markmc): ignoring lower_bound - flag_values.define_integer(name, default, help) - - -def DEFINE_bool(name, default, help, flag_values=FLAGS): - flag_values.define_bool(name, default, help) - - -def DEFINE_boolean(name, default, help, flag_values=FLAGS): - DEFINE_bool(name, default, help, flag_values) - - -def DEFINE_list(name, default, help, flag_values=FLAGS): - flag_values.define_list(name, default, help) - - -def DEFINE_float(name, default, help, flag_values=FLAGS): - flag_values.define_float(name, default, help) - - -def DEFINE_multistring(name, default, help, flag_values=FLAGS): - flag_values.define_multistring(name, default, help) - - class UnrecognizedFlag(Exception): pass @@ -238,227 +195,346 @@ def _get_my_ip(): return "127.0.0.1" -# __GLOBAL FLAGS ONLY__ -# Define any app-specific flags in their own files, docs at: -# http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#a9 -DEFINE_string('my_ip', _get_my_ip(), 'host ip address') -DEFINE_list('region_list', - [], - 'list of region=fqdn pairs separated by commas') -DEFINE_string('connection_type', None, 'libvirt, xenapi or fake') -DEFINE_string('aws_access_key_id', 'admin', 'AWS Access ID') -DEFINE_string('aws_secret_access_key', 'admin', 'AWS Access Key') -# NOTE(sirp): my_ip interpolation doesn't work within nested structures -DEFINE_string('glance_host', _get_my_ip(), 'default glance host') -DEFINE_integer('glance_port', 9292, 'default glance port') -DEFINE_list('glance_api_servers', - ['%s:%d' % (FLAGS.glance_host, FLAGS.glance_port)], - 'list of glance api servers available to nova (host:port)') -DEFINE_integer('glance_num_retries', 0, - 'The number of times to retry downloading an image from glance') -DEFINE_integer('s3_port', 3333, 's3 port') -DEFINE_string('s3_host', '$my_ip', 's3 host (for infrastructure)') -DEFINE_string('s3_dmz', '$my_ip', 's3 dmz ip (for instances)') -DEFINE_string('cert_topic', 'cert', 'the topic cert nodes listen on') -DEFINE_string('compute_topic', 'compute', 'the topic compute nodes listen on') -DEFINE_string('console_topic', 'console', - 'the topic console proxy nodes listen on') -DEFINE_string('scheduler_topic', 'scheduler', - 'the topic scheduler nodes listen on') -DEFINE_string('volume_topic', 'volume', 'the topic volume nodes listen on') -DEFINE_string('network_topic', 'network', 'the topic network nodes listen on') -DEFINE_string('ajax_console_proxy_topic', 'ajax_proxy', - 'the topic ajax proxy nodes listen on') -DEFINE_string('ajax_console_proxy_url', - 'http://127.0.0.1:8000', - 'location of ajax console proxy, \ - in the form "http://127.0.0.1:8000"') -DEFINE_integer('ajax_console_proxy_port', - 8000, 'port that ajax_console_proxy binds') -DEFINE_string('vsa_topic', 'vsa', 'the topic that nova-vsa service listens on') -DEFINE_bool('verbose', False, 'show debug output') -DEFINE_boolean('fake_rabbit', False, 'use a fake rabbit') -DEFINE_bool('fake_network', False, - 'should we use fake network devices and addresses') -DEFINE_string('rabbit_host', 'localhost', 'rabbit host') -DEFINE_integer('rabbit_port', 5672, 'rabbit port') -DEFINE_bool('rabbit_use_ssl', False, 'connect over SSL') -DEFINE_string('rabbit_userid', 'guest', 'rabbit userid') -DEFINE_string('rabbit_password', 'guest', 'rabbit password') -DEFINE_string('rabbit_virtual_host', '/', 'rabbit virtual host') -DEFINE_integer('rabbit_retry_interval', 1, - 'rabbit connection retry interval to start') -DEFINE_integer('rabbit_retry_backoff', 2, - 'rabbit connection retry backoff in seconds') -DEFINE_integer('rabbit_max_retries', 0, - 'maximum rabbit connection attempts (0=try forever)') -DEFINE_string('control_exchange', 'nova', 'the main exchange to connect to') -DEFINE_boolean('rabbit_durable_queues', False, 'use durable queues') -DEFINE_list('enabled_apis', - ['ec2', 'osapi_compute', 'osapi_volume', 'metadata'], - 'list of APIs to enable by default') -DEFINE_string('ec2_host', '$my_ip', 'ip of api server') -DEFINE_string('ec2_dmz_host', '$my_ip', 'internal ip of api server') -DEFINE_integer('ec2_port', 8773, 'cloud controller port') -DEFINE_string('ec2_scheme', 'http', 'prefix for ec2') -DEFINE_string('ec2_path', '/services/Cloud', 'suffix for ec2') -DEFINE_multistring('osapi_compute_extension', - ['nova.api.openstack.compute.contrib.standard_extensions'], - 'osapi compute extension to load') -DEFINE_multistring('osapi_volume_extension', - ['nova.api.openstack.volume.contrib.standard_extensions'], - 'osapi volume extension to load') -DEFINE_string('osapi_scheme', 'http', 'prefix for openstack') -DEFINE_string('osapi_path', '/v1.1/', 'suffix for openstack') -DEFINE_integer('osapi_max_limit', 1000, - 'max number of items returned in a collection response') -DEFINE_string('metadata_host', '$my_ip', 'ip of metadata server') -DEFINE_integer('metadata_port', 8775, 'Metadata API port') -DEFINE_string('default_project', 'openstack', 'default project for openstack') -DEFINE_string('default_image', 'ami-11111', - 'default image to use, testing only') -DEFINE_string('default_instance_type', 'm1.small', - 'default instance type to use, testing only') -DEFINE_string('null_kernel', 'nokernel', - 'kernel image that indicates not to use a kernel,' - ' but to use a raw disk image instead') - -DEFINE_string('vpn_image_id', '0', 'image id for cloudpipe vpn server') -DEFINE_string('vpn_key_suffix', - '-vpn', - 'Suffix to add to project name for vpn key and secgroups') - -DEFINE_integer('auth_token_ttl', 3600, 'Seconds for auth tokens to linger') - -DEFINE_string('state_path', os.path.join(os.path.dirname(__file__), '../'), - "Top-level directory for maintaining nova's state") -DEFINE_string('lock_path', os.path.join(os.path.dirname(__file__), '../'), - 'Directory for lock files') -DEFINE_string('logdir', None, 'output to a per-service log file in named ' - 'directory') -DEFINE_string('logfile_mode', '0644', 'Default file mode of the logs.') -DEFINE_string('sqlite_db', 'nova.sqlite', 'file name for sqlite') -DEFINE_bool('sqlite_synchronous', True, 'Synchronous mode for sqlite') -DEFINE_string('sql_connection', - 'sqlite:///$state_path/$sqlite_db', - 'connection string for sql database') -DEFINE_integer('sql_idle_timeout', - 3600, - 'timeout for idle sql database connections') -DEFINE_integer('sql_max_retries', 12, 'sql connection attempts') -DEFINE_integer('sql_retry_interval', 10, 'sql connection retry interval') - -DEFINE_string('compute_manager', 'nova.compute.manager.ComputeManager', - 'Manager for compute') -DEFINE_string('console_manager', 'nova.console.manager.ConsoleProxyManager', - 'Manager for console proxy') -DEFINE_string('cert_manager', 'nova.cert.manager.CertManager', - 'Manager for cert') -DEFINE_string('instance_dns_manager', - 'nova.network.dns_driver.DNSDriver', - 'DNS Manager for instance IPs') -DEFINE_string('instance_dns_domain', '', - 'DNS Zone for instance IPs') -DEFINE_string('floating_ip_dns_manager', - 'nova.network.dns_driver.DNSDriver', - 'DNS Manager for floating IPs') -DEFINE_string('network_manager', 'nova.network.manager.VlanManager', - 'Manager for network') -DEFINE_string('volume_manager', 'nova.volume.manager.VolumeManager', - 'Manager for volume') -DEFINE_string('scheduler_manager', 'nova.scheduler.manager.SchedulerManager', - 'Manager for scheduler') -DEFINE_string('vsa_manager', 'nova.vsa.manager.VsaManager', - 'Manager for vsa') -DEFINE_string('vc_image_name', 'vc_image', - 'the VC image ID (for a VC image that exists in DB Glance)') -# VSA constants and enums -DEFINE_string('default_vsa_instance_type', 'm1.small', - 'default instance type for VSA instances') -DEFINE_integer('max_vcs_in_vsa', 32, - 'maxinum VCs in a VSA') -DEFINE_integer('vsa_part_size_gb', 100, - 'default partition size for shared capacity') -# Default firewall driver for security groups and provider firewall -DEFINE_string('firewall_driver', - 'nova.virt.libvirt.firewall.IptablesFirewallDriver', - 'Firewall driver (defaults to iptables)') -# The service to use for image search and retrieval -DEFINE_string('image_service', 'nova.image.glance.GlanceImageService', - 'The service to use for retrieving and searching for images.') - -DEFINE_string('host', socket.gethostname(), - 'Name of this node. This can be an opaque identifier. It is ' - 'not necessarily a hostname, FQDN, or IP address.') - -DEFINE_string('node_availability_zone', 'nova', - 'availability zone of this node') - -DEFINE_string('notification_driver', - 'nova.notifier.no_op_notifier', - 'Default driver for sending notifications') -DEFINE_list('memcached_servers', None, - 'Memcached servers or None for in process cache.') - -DEFINE_string('zone_name', 'nova', 'name of this zone') -DEFINE_list('zone_capabilities', - ['hypervisor=xenserver;kvm', 'os=linux;windows'], - 'Key/Multi-value list representng capabilities of this zone') -DEFINE_string('build_plan_encryption_key', None, - '128bit (hex) encryption key for scheduler build plans.') -DEFINE_string('instance_usage_audit_period', 'month', - 'time period to generate instance usages for.') -DEFINE_integer('bandwith_poll_interval', 600, - 'interval to pull bandwidth usage info') - -DEFINE_bool('start_guests_on_host_boot', False, - 'Whether to restart guests when the host reboots') -DEFINE_bool('resume_guests_state_on_host_boot', False, - 'Whether to start guests, that was running before the host reboot') -DEFINE_string('default_ephemeral_format', - None, - 'The default format a ephemeral_volume will be formatted ' - 'with on creation.') - -DEFINE_string('root_helper', 'sudo', - 'Command prefix to use for running commands as root') - -DEFINE_string('network_driver', 'nova.network.linux_net', - 'Driver to use for network creation') - -DEFINE_bool('use_ipv6', False, 'use ipv6') - -DEFINE_integer('password_length', 12, - 'Length of generated instance admin passwords') - -DEFINE_bool('monkey_patch', False, - 'Whether to log monkey patching') - -DEFINE_list('monkey_patch_modules', - ['nova.api.ec2.cloud:nova.notifier.api.notify_decorator', - 'nova.compute.api:nova.notifier.api.notify_decorator'], - 'Module list representing monkey ' - 'patched module and decorator') - -DEFINE_bool('allow_resize_to_same_host', False, - 'Allow destination machine to match source for resize. Useful' - ' when testing in environments with only one host machine.') - -DEFINE_string('stub_network', False, - 'Stub network related code') - -DEFINE_integer('reclaim_instance_interval', 0, - 'Interval in seconds for reclaiming deleted instances') - -DEFINE_integer('zombie_instance_updated_at_window', 172800, - 'Limit in seconds that a zombie instance can exist before ' - 'being cleaned up.') - -DEFINE_boolean('allow_ec2_admin_api', False, 'Enable/Disable EC2 Admin API') - -DEFINE_integer('service_down_time', 60, - 'maximum time since last check-in for up service') -DEFINE_string('default_schedule_zone', None, - 'zone to use when user doesnt specify one') -DEFINE_list('isolated_images', [], 'Images to run on isolated host') -DEFINE_list('isolated_hosts', [], 'Host reserved for specific images') +global_opts = [ + cfg.StrOpt('my_ip', + default=_get_my_ip(), + help='host ip address'), + cfg.ListOpt('region_list', + default=[], + help='list of region=fqdn pairs separated by commas'), + cfg.StrOpt('connection_type', + default=None, + help='libvirt, xenapi or fake'), + cfg.StrOpt('aws_access_key_id', + default='admin', + help='AWS Access ID'), + cfg.StrOpt('aws_secret_access_key', + default='admin', + help='AWS Access Key'), + cfg.StrOpt('glance_host', + default='$my_ip', + help='default glance host'), + cfg.IntOpt('glance_port', + default=9292, + help='default glance port'), + cfg.ListOpt('glance_api_servers', + default=['$glance_host:$glance_port'], + help='glance api servers available to nova (host:port)'), + cfg.IntOpt('glance_num_retries', + default=0, + help='Number retries when downloading an image from glance'), + cfg.IntOpt('s3_port', + default=3333, + help='s3 port'), + cfg.StrOpt('s3_host', + default='$my_ip', + help='s3 host (for infrastructure)'), + cfg.StrOpt('s3_dmz', + default='$my_ip', + help='s3 dmz ip (for instances)'), + cfg.StrOpt('cert_topic', + default='cert', + help='the topic cert nodes listen on'), + cfg.StrOpt('compute_topic', + default='compute', + help='the topic compute nodes listen on'), + cfg.StrOpt('console_topic', + default='console', + help='the topic console proxy nodes listen on'), + cfg.StrOpt('scheduler_topic', + default='scheduler', + help='the topic scheduler nodes listen on'), + cfg.StrOpt('volume_topic', + default='volume', + help='the topic volume nodes listen on'), + cfg.StrOpt('network_topic', + default='network', + help='the topic network nodes listen on'), + cfg.StrOpt('ajax_console_proxy_topic', + default='ajax_proxy', + help='the topic ajax proxy nodes listen on'), + cfg.StrOpt('ajax_console_proxy_url', + default='http://127.0.0.1:8000', + help='URL of ajax console proxy, in the form http://host:port'), + cfg.IntOpt('ajax_console_proxy_port', + default=8000, + help='port that ajax_console_proxy binds'), + cfg.StrOpt('vsa_topic', + default='vsa', + help='the topic that nova-vsa service listens on'), + cfg.BoolOpt('verbose', + default=False, + help='show debug output'), + cfg.BoolOpt('fake_rabbit', + default=False, + help='use a fake rabbit'), + cfg.BoolOpt('fake_network', + default=False, + help='should we use fake network devices and addresses'), + cfg.StrOpt('rabbit_host', + default='localhost', + help='rabbit host'), + cfg.IntOpt('rabbit_port', + default=5672, + help='rabbit port'), + cfg.BoolOpt('rabbit_use_ssl', + default=False, + help='connect over SSL'), + cfg.StrOpt('rabbit_userid', + default='guest', + help='rabbit userid'), + cfg.StrOpt('rabbit_password', + default='guest', + help='rabbit password'), + cfg.StrOpt('rabbit_virtual_host', + default='/', + help='rabbit virtual host'), + cfg.IntOpt('rabbit_retry_interval', + default=1, + help='rabbit connection retry interval to start'), + cfg.IntOpt('rabbit_retry_backoff', + default=2, + help='rabbit connection retry backoff in seconds'), + cfg.IntOpt('rabbit_max_retries', + default=0, + help='maximum rabbit connection attempts (0=try forever)'), + cfg.StrOpt('control_exchange', + default='nova', + help='the main exchange to connect to'), + cfg.BoolOpt('rabbit_durable_queues', + default=False, + help='use durable queues'), + cfg.ListOpt('enabled_apis', + default=['ec2', 'osapi_compute', 'osapi_volume', 'metadata'], + help='list of APIs to enable by default'), + cfg.StrOpt('ec2_host', + default='$my_ip', + help='ip of api server'), + cfg.StrOpt('ec2_dmz_host', + default='$my_ip', + help='internal ip of api server'), + cfg.IntOpt('ec2_port', + default=8773, + help='cloud controller port'), + cfg.StrOpt('ec2_scheme', + default='http', + help='prefix for ec2'), + cfg.StrOpt('ec2_path', + default='/services/Cloud', + help='suffix for ec2'), + cfg.MultiStrOpt('osapi_compute_extension', + default=[ + 'nova.api.openstack.compute.contrib.standard_extensions' + ], + help='osapi compute extension to load'), + cfg.MultiStrOpt('osapi_volume_extension', + default=[ + 'nova.api.openstack.volume.contrib.standard_extensions' + ], + help='osapi volume extension to load'), + cfg.StrOpt('osapi_scheme', + default='http', + help='prefix for openstack'), + cfg.StrOpt('osapi_path', + default='/v1.1/', + help='suffix for openstack'), + cfg.IntOpt('osapi_max_limit', + default=1000, + help='max number of items returned in a collection response'), + cfg.StrOpt('metadata_host', + default='$my_ip', + help='ip of metadata server'), + cfg.IntOpt('metadata_port', + default=8775, + help='Metadata API port'), + cfg.StrOpt('default_project', + default='openstack', + help='default project for openstack'), + cfg.StrOpt('default_image', + default='ami-11111', + help='default image to use, testing only'), + cfg.StrOpt('default_instance_type', + default='m1.small', + help='default instance type to use, testing only'), + cfg.StrOpt('null_kernel', + default='nokernel', + help='kernel image that indicates not to use a kernel, but to ' + 'use a raw disk image instead'), + cfg.StrOpt('vpn_image_id', + default='0', + help='image id for cloudpipe vpn server'), + cfg.StrOpt('vpn_key_suffix', + default='-vpn', + help='Suffix to add to project name for vpn key and secgroups'), + cfg.IntOpt('auth_token_ttl', + default=3600, + help='Seconds for auth tokens to linger'), + cfg.StrOpt('state_path', + default=os.path.join(os.path.dirname(__file__), '../'), + help="Top-level directory for maintaining nova's state"), + cfg.StrOpt('lock_path', + default=os.path.join(os.path.dirname(__file__), '../'), + help='Directory for lock files'), + cfg.StrOpt('logdir', + default=None, + help='output to a per-service log file in named directory'), + cfg.StrOpt('logfile_mode', + default='0644', + help='Default file mode of the logs.'), + cfg.StrOpt('sqlite_db', + default='nova.sqlite', + help='file name for sqlite'), + cfg.BoolOpt('sqlite_synchronous', + default=True, + help='Synchronous mode for sqlite'), + cfg.StrOpt('sql_connection', + default='sqlite:///$state_path/$sqlite_db', + help='connection string for sql database'), + cfg.IntOpt('sql_idle_timeout', + default=3600, + help='timeout for idle sql database connections'), + cfg.IntOpt('sql_max_retries', + default=12, + help='sql connection attempts'), + cfg.IntOpt('sql_retry_interval', + default=10, + help='sql connection retry interval'), + cfg.StrOpt('compute_manager', + default='nova.compute.manager.ComputeManager', + help='Manager for compute'), + cfg.StrOpt('console_manager', + default='nova.console.manager.ConsoleProxyManager', + help='Manager for console proxy'), + cfg.StrOpt('cert_manager', + default='nova.cert.manager.CertManager', + help='Manager for cert'), + cfg.StrOpt('instance_dns_manager', + default='nova.network.dns_driver.DNSDriver', + help='DNS Manager for instance IPs'), + cfg.StrOpt('instance_dns_domain', + default='', + help='DNS Zone for instance IPs'), + cfg.StrOpt('floating_ip_dns_manager', + default='nova.network.dns_driver.DNSDriver', + help='DNS Manager for floating IPs'), + cfg.StrOpt('network_manager', + default='nova.network.manager.VlanManager', + help='Manager for network'), + cfg.StrOpt('volume_manager', + default='nova.volume.manager.VolumeManager', + help='Manager for volume'), + cfg.StrOpt('scheduler_manager', + default='nova.scheduler.manager.SchedulerManager', + help='Manager for scheduler'), + cfg.StrOpt('vsa_manager', + default='nova.vsa.manager.VsaManager', + help='Manager for vsa'), + cfg.StrOpt('vc_image_name', + default='vc_image', + help='the VC image ID (for a VC image that exists in Glance)'), + cfg.StrOpt('default_vsa_instance_type', + default='m1.small', + help='default instance type for VSA instances'), + cfg.IntOpt('max_vcs_in_vsa', + default=32, + help='maxinum VCs in a VSA'), + cfg.IntOpt('vsa_part_size_gb', + default=100, + help='default partition size for shared capacity'), + cfg.StrOpt('firewall_driver', + default='nova.virt.libvirt.firewall.IptablesFirewallDriver', + help='Firewall driver (defaults to iptables)'), + cfg.StrOpt('image_service', + default='nova.image.glance.GlanceImageService', + help='The service to use for retrieving and searching images.'), + cfg.StrOpt('host', + default=socket.gethostname(), + help='Name of this node. This can be an opaque identifier. ' + 'It is not necessarily a hostname, FQDN, or IP address.'), + cfg.StrOpt('node_availability_zone', + default='nova', + help='availability zone of this node'), + cfg.StrOpt('notification_driver', + default='nova.notifier.no_op_notifier', + help='Default driver for sending notifications'), + cfg.ListOpt('memcached_servers', + default=None, + help='Memcached servers or None for in process cache.'), + cfg.StrOpt('zone_name', + default='nova', + help='name of this zone'), + cfg.ListOpt('zone_capabilities', + default=['hypervisor=xenserver;kvm', 'os=linux;windows'], + help='Key/Multi-value list with the capabilities of the zone'), + cfg.StrOpt('build_plan_encryption_key', + default=None, + help='128bit (hex) encryption key for scheduler build plans.'), + cfg.StrOpt('instance_usage_audit_period', + default='month', + help='time period to generate instance usages for.'), + cfg.IntOpt('bandwith_poll_interval', + default=600, + help='interval to pull bandwidth usage info'), + cfg.BoolOpt('start_guests_on_host_boot', + default=False, + help='Whether to restart guests when the host reboots'), + cfg.BoolOpt('resume_guests_state_on_host_boot', + default=False, + help='Whether to start guests that were running before the ' + 'host rebooted'), + cfg.StrOpt('default_ephemeral_format', + default=None, + help='The default format a ephemeral_volume will be ' + 'formatted with on creation.'), + cfg.StrOpt('root_helper', + default='sudo', + help='Command prefix to use for running commands as root'), + cfg.StrOpt('network_driver', + default='nova.network.linux_net', + help='Driver to use for network creation'), + cfg.BoolOpt('use_ipv6', + default=False, + help='use ipv6'), + cfg.IntOpt('password_length', + default=12, + help='Length of generated instance admin passwords'), + cfg.BoolOpt('monkey_patch', + default=False, + help='Whether to log monkey patching'), + cfg.ListOpt('monkey_patch_modules', + default=[ + 'nova.api.ec2.cloud:nova.notifier.api.notify_decorator', + 'nova.compute.api:nova.notifier.api.notify_decorator' + ], + help='List of modules/decorators to monkey patch'), + cfg.BoolOpt('allow_resize_to_same_host', + default=False, + help='Allow destination machine to match source for resize. ' + 'Useful when testing in single-host environments.'), + cfg.StrOpt('stub_network', + default=False, + help='Stub network related code'), + cfg.IntOpt('reclaim_instance_interval', + default=0, + help='Interval in seconds for reclaiming deleted instances'), + cfg.IntOpt('zombie_instance_updated_at_window', + default=172800, + help='Number of seconds zombie instances are cleaned up.'), + cfg.BoolOpt('allow_ec2_admin_api', + default=False, + help='Enable/Disable EC2 Admin API'), + cfg.IntOpt('service_down_time', + default=60, + help='maximum time since last check-in for up service'), + cfg.StrOpt('default_schedule_zone', + default=None, + help='zone to use when user doesnt specify one'), + cfg.ListOpt('isolated_images', + default=[], + help='Images to run on isolated host'), + cfg.ListOpt('isolated_hosts', + default=[], + help='Host reserved for specific images'), + ] + +FLAGS.add_options(global_opts) |
