def test_flagfile(self): opts = [ cfg.StrOpt('string', default='default', help='desc'), cfg.IntOpt('int', default=1, help='desc'), cfg.BoolOpt('false', default=False, help='desc'), cfg.BoolOpt('true', default=True, help='desc'), cfg.MultiStrOpt('multi', default=['blaa'], help='desc'), ] self.FLAGS.register_opts(opts) (fd, path) = tempfile.mkstemp(prefix='nova', suffix='.flags') try: os.write(fd, '--string=foo\n--int=2\n--false\n--notrue\n') os.write(fd, '--multi=foo\n') # FIXME(markmc): --multi=bar\n') os.close(fd) self.FLAGS(['flags_test', '--flagfile=' + path]) self.assertEqual(self.FLAGS.string, 'foo') self.assertEqual(self.FLAGS.int, 2) self.assertEqual(self.FLAGS.false, True) self.assertEqual(self.FLAGS.true, False) self.assertEqual(self.FLAGS.multi, ['foo']) # FIXME(markmc): 'bar' # Re-parse to test multistring isn't append multiple times self.FLAGS(['flags_test', '--flagfile=' + path]) self.assertEqual(self.FLAGS.multi, ['foo']) # FIXME(markmc): 'bar' finally: os.remove(path)
ldap_dns_opts = [ cfg.StrOpt('ldap_dns_url', default='ldap://ldap.example.com:389', help='URL for ldap server which will store dns entries'), cfg.StrOpt('ldap_dns_user', default='uid=admin,ou=people,dc=example,dc=org', help='user for ldap DNS'), cfg.StrOpt('ldap_dns_password', default='password', help='password for ldap DNS'), cfg.StrOpt('ldap_dns_soa_hostmain', default='*****@*****.**', help='Hostmain for ldap dns driver Statement of Authority'), cfg.MultiStrOpt('ldap_dns_servers', default=['dns.example.org'], help='DNS Servers for ldap dns driver'), cfg.StrOpt('ldap_dns_base_dn', default='ou=hosts,dc=example,dc=org', help='Base DN for DNS entries in ldap'), cfg.StrOpt('ldap_dns_soa_refresh', default='1800', help='Refresh interval (in seconds) for ldap dns driver ' 'Statement of Authority'), cfg.StrOpt('ldap_dns_soa_retry', default='3600', help='Retry interval (in seconds) for ldap dns driver ' 'Statement of Authority'), cfg.StrOpt('ldap_dns_soa_expiry', default='86400', help='Expiry interval (in seconds) for ldap dns driver '
import UserDict from nova.compute import task_states from nova.compute import vm_states from nova import db from nova import exception from nova.openstack.common import cfg from nova.openstack.common import log as logging from nova.openstack.common import timeutils from nova.scheduler import filters from nova.scheduler import weights host_manager_opts = [ cfg.MultiStrOpt('scheduler_available_filters', default=['nova.scheduler.filters.all_filters'], help='Filter classes available to the scheduler which may ' 'be specified more than once. An entry of ' '"nova.scheduler.filters.standard_filters" ' 'maps to all filters included with nova.'), cfg.ListOpt('scheduler_default_filters', default=[ 'RetryFilter', 'AvailabilityZoneFilter', 'RamFilter', 'ComputeFilter', 'ComputeCapabilitiesFilter', 'ImagePropertiesFilter' ], help='Which filter class names to use for filtering hosts ' 'when not specified in the request.'), cfg.ListOpt('scheduler_weight_classes', default=['nova.scheduler.weights.all_weighers'], help='Which weight class names to use for weighing hosts'), ]
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from nova import exception from nova import flags from nova import log as logging from nova.openstack.common import cfg from nova import utils list_notifier_drivers_opt = cfg.MultiStrOpt( 'list_notifier_drivers', default=['nova.notifier.no_op_notifier'], help='List of drivers to send notifications') FLAGS = flags.FLAGS FLAGS.register_opt(list_notifier_drivers_opt) LOG = logging.getLogger(__name__) drivers = None class ImportFailureNotifier(object): """Noisily re-raises some exception over-and-over when notify is called.""" def __init__(self, exception): self.exception = exception
# NOTE(yamahata): ListOpt won't work because the command may include a # comma. For example: # # mkfs.ext3 -O dir_index,extent -E stride=8,stripe-width=16 # --label %(fs_label)s %(target)s # # list arguments are comma separated and there is no way to # escape such commas. # cfg.MultiStrOpt('virt_mkfs', default=[ 'default=mkfs.ext3 -L %(fs_label)s -F %(target)s', 'linux=mkfs.ext3 -L %(fs_label)s -F %(target)s', 'windows=mkfs.ntfs' ' --force --fast --label %(fs_label)s %(target)s', # NOTE(yamahata): vfat case #'windows=mkfs.vfat -n %(fs_label)s %(target)s', ], help='mkfs commands for ephemeral device. ' 'The format is <os_type>=<mkfs command>'), ] FLAGS = flags.FLAGS FLAGS.register_opts(disk_opts) _MKFS_COMMAND = {} _DEFAULT_MKFS_COMMAND = None for s in FLAGS.virt_mkfs:
help='the port of the ec2 api server'), cfg.StrOpt('ec2_scheme', default='http', help='the protocol to use when connecting to the ec2 api ' 'server (http, https)'), cfg.StrOpt('ec2_path', default='/services/Cloud', help='the path prefix used to call the ec2 api server'), cfg.ListOpt('osapi_compute_ext_list', default=[], help='Specify list of extensions to load when using osapi_' 'compute_extension option with nova.api.openstack.' 'compute.contrib.select_extensions'), cfg.MultiStrOpt('osapi_compute_extension', default=[ 'nova.api.openstack.compute.contrib.standard_extensions' ], help='osapi compute extension to load'), cfg.ListOpt('osapi_volume_ext_list', default=[], help='Specify list of extensions to load when using osapi_' 'volume_extension option with nova.api.openstack.' 'volume.contrib.select_extensions'), cfg.MultiStrOpt('osapi_volume_extension', default=[ 'nova.api.openstack.volume.contrib.standard_extensions' ], help='osapi volume extension to load'), cfg.StrOpt('osapi_path', default='/v1.1/', help='the path prefix used to call the openstack api server'),
import uuid from nova.openstack.common import cfg from nova.openstack.common import context from nova.openstack.common.gettextutils import _ from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common import timeutils LOG = logging.getLogger(__name__) notifier_opts = [ cfg.MultiStrOpt('notification_driver', default=[], deprecated_name='list_notifier_drivers', help='Driver or drivers to handle sending notifications'), cfg.StrOpt('default_notification_level', default='INFO', help='Default notification level for outgoing notifications'), cfg.StrOpt('default_publisher_id', default='$host', help='Default publisher_id for outgoing notifications'), ] CONF = cfg.CONF CONF.register_opts(notifier_opts) WARN = 'WARN' INFO = 'INFO' ERROR = 'ERROR'
cfg.StrOpt('wiki_keystone_login', default='keystonelogin', help='keystone admin login'), cfg.StrOpt('wiki_keystone_password', default='keystonepass', help='keystone admin password'), cfg.MultiStrOpt('wiki_eventtype_whitelist', default=[ 'compute.instance.delete.start', 'compute.instance.create.start', 'compute.instance.create.end', 'compute.instance.rebuild.start', 'compute.instance.rebuild.end', 'compute.instance.resize.start', 'compute.instance.resize.end', 'compute.instance.create_ip.end', 'compute.instance.delete_ip.end', 'compute.instance.suspend', 'compute.instance.resume', 'compute.instance.exists', 'compute.instance.forcewikistatusupdate', 'compute.instance.reboot.start', 'compute.instance.reboot.end', ], help='Event types to always handle.'), cfg.MultiStrOpt( 'wiki_eventtype_blacklist', default=[], help='Event types to always ignore.' 'In the event of a conflict, this overrides the whitelist.'), ]