From d0abb8c2906ca05ea2e294320531238aa7047958 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Fri, 5 Jul 2013 11:07:55 +1000 Subject: [PATCH] Add Autogenerate-config-doc code to tools This patch brings the auto-generate-config doc tool into the openstack-manuals repo, where it can be used to update the configuration option tables. patchset2 fixes obvious things noted by reviewers, likely needs more fixing. patchset 4 adds update feature, fixes pep8 patchset 5 removes debugging print patchset 6 adds warning to tables regarding their automatically generated nature patchset 7 updated nova flagmappings for H2 and adds updated nova tables patchset 8 adds a seciton in the readme with a worked example from a recent use of the script patchset 10 fixes for cinder patchset 11 testing, fixing patchset 12 testing, fixing patchset 13 adds categories to cinder.flagmappings, generates docbook tables for cinder patchset 14 adds mappings for neutron, and generates docbook tables based on these patchset 15 adds list of bugs this patch will fix patchset 16 fixes whitespace error in automatically generated tables :( fixes bug 1192225 Partial-Bug 1207550 Partial-Bug 1207549 fixes bug 1206827 Partial-Bug 1206336 fixes bug 1204484 Partial-Bug 1204205 fixes bug 1202260 fixes bug 1201710 fixes bug 1200794 Partial-Bug 1200740 Partial-Bug 1200418 Partial-Bug 1200047 Partial-Bug 1199209 Partial-Bug 1197657 fixes bug 1197653 fixes bug 1197295 Partial-Bug 1197088 Partial-Bug 1195900 fixes bug 1195560 fixes bug 1195433 Partial-Bug 1192752 fixes bug 1187278 Partial-Bug 1106428 Change-Id: Icd3f4496850c375c9359a10eddb25ab5c722595e bp:autogenerate-config-tables --- autogenerate-config-docs/.gitignore | 9 + autogenerate-config-docs/README.md | 105 +++ autogenerate-config-docs/autohelp.py | 65 ++ autogenerate-config-docs/common.py | 400 ++++++++++++ .../flagmappings/ceilometer.flagmappings | 142 ++++ .../flagmappings/cinder.flagmappings | 297 +++++++++ .../flagmappings/glance.flagmappings | 131 ++++ .../flagmappings/neutron.flagmappings | 271 ++++++++ .../flagmappings/nova.flagmappings | 607 ++++++++++++++++++ autogenerate-config-docs/flow.dia | Bin 0 -> 3206 bytes autogenerate-config-docs/test/README.md | 3 + autogenerate-config-docs/test/genconfs.sh | 31 + autogenerate-config-docs/test/generator.py | 262 ++++++++ 13 files changed, 2323 insertions(+) create mode 100644 autogenerate-config-docs/.gitignore create mode 100644 autogenerate-config-docs/README.md create mode 100755 autogenerate-config-docs/autohelp.py create mode 100644 autogenerate-config-docs/common.py create mode 100644 autogenerate-config-docs/flagmappings/ceilometer.flagmappings create mode 100644 autogenerate-config-docs/flagmappings/cinder.flagmappings create mode 100644 autogenerate-config-docs/flagmappings/glance.flagmappings create mode 100644 autogenerate-config-docs/flagmappings/neutron.flagmappings create mode 100644 autogenerate-config-docs/flagmappings/nova.flagmappings create mode 100644 autogenerate-config-docs/flow.dia create mode 100644 autogenerate-config-docs/test/README.md create mode 100755 autogenerate-config-docs/test/genconfs.sh create mode 100755 autogenerate-config-docs/test/generator.py diff --git a/autogenerate-config-docs/.gitignore b/autogenerate-config-docs/.gitignore new file mode 100644 index 00000000..0ad0c6b5 --- /dev/null +++ b/autogenerate-config-docs/.gitignore @@ -0,0 +1,9 @@ +*.DS_Store +*.egg* +*.log +*.mo +*.pyc +*.swo +*.swp +*.sqlite +*~ diff --git a/autogenerate-config-docs/README.md b/autogenerate-config-docs/README.md new file mode 100644 index 00000000..beb1ffd0 --- /dev/null +++ b/autogenerate-config-docs/README.md @@ -0,0 +1,105 @@ +autogenerate-config-docs +======================== + +Automatically generate configuration tables to document OpenStack. + + +Dependencies: python-git (version: 0.3.2 RC1), oslo.config + +Setting up your environment +--------------------------- + +Note: This tool is best run in a fresh VM environment, as running it + requires installing the dependencies of the particular OpenStack + product you are working with. Installing all of that on your normal +machine could leave you with a bunch of cruft! + +First install git and python-pip, + + $ sudo apt-get install git python-pip + +next, install oslo.config and GitPython + + $ sudo pip install oslo.config GitPython + +then, checkout the repository you are working with: + + $ git clone https://github.com/openstack/nova.git + + (this guide makes reference to a /repos directory, so you should + record the directory you are using and replace as appropriate below) + +and the tool itself: + + $ git clone https://github.com/openstack/openstack-manuals.git + + +and finally, the dependencies for the product you are working with: + + $ sudo pip install -r nova/requirements.txt + +Now you are ready to use the tool. + + +Using the tool +-------------- + +This tool is divided into three parts: + +1) Extraction of flags names +eg + + $ ./autohelp.py --action create -i flagmappings/nova.flagmappings -o names --path /repos/nova + +2) Grouping of flags + +This is currently done manually, by using the flag name file and placing +a category after a space. + +eg + + $ head flagmappings/glance.flagmappings + admin\_password registry + admin\_role api + admin\_tenant\_name registry + admin\_user registry + ... + +3) Creation of docbook-formatted configuration table files + +eg + + $ ./autohelp.py --action create -i flagmappings/nova.flagmappings -o docbook --path /repos/nova + +A worked example - updating the docs for H2 +---------------------------------------------------- +update automatically generated tables - from scratch + + $ sudo apt-get update + $ sudo apt-get install git python-pip python-dev + $ sudo pip install git-review GitPython + $ git clone git://github.com/openstack/openstack-manuals.git + $ cd openstack-manuals/ + $ git review -d 35726 + $ cd tools/autogenerate-config-docs/ + +Now, cloning and installing requirements for nova, glance, quantum + + $ for i in nova glance quantum; do git clone git://github.com/openstack/$i.git; done + $ for i in nova glance quantum; do sudo pip install -r $i/requirements.txt; done + +This missed some requirements for nova, which were fixed by: + + $ sudo pip install python-glanceclient websockify pyasn1 python-cinderclient error\_util + $ sudo apt-get install python-ldap python-lxml + +Making the flag names update + + ./autohelp.py -vvv --action update -i flagmappings/nova.flagmappings -o names --path ~/nova | more + +At this point, seach through flagmappings/nova.flagmappings.new for anything labelled Unknown and fix, +once that is done use: + + ./autohelp.py -vvv --action create -i flagmappings/nova.flagmappings -o docbook --path ~/nova + +to generate the XML files and move those into the appropriate part ofthe git repo diff --git a/autogenerate-config-docs/autohelp.py b/autogenerate-config-docs/autohelp.py new file mode 100755 index 00000000..5b6e0e5e --- /dev/null +++ b/autogenerate-config-docs/autohelp.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# +# A collection of tools for working with flags from OpenStack +# packages and documentation. +# +# For an example of usage, run this program with the -h switch. +# + +import os +import sys + +# this is for the internationalisation function in gettext +import __builtin__ +__builtin__.__dict__['_'] = lambda x: x + +import common + + +def main(action, file, format, repo, verbose=0, name=False, test=False): + package_name = common.git_check(repo) + + sys.path.append(repo) + try: + __import__(package_name) + except ImportError as e: + if verbose >= 1: + print str(e) + print "Failed to import: %s (%s)" % (package_name, e) + + if verbose >= 1: + flags = common.extract_flags(repo, package_name, verbose) + else: + flags = common.extract_flags(repo, package_name) + + print "%s flags imported from package %s." % (len(flags), + str(package_name)) + if action == "update": + common.update(file, flags, True, verbose) + return + + if format == "names": + if verbose >= 1: + common.write_flags(file, flags, True, verbose) + else: + common.write_flags(file, flags, True) + + if format == "docbook": + groups = common.populate_groups(file) + print "%s groups" % len(groups) + if verbose >= 1: + common.write_docbook('.', flags, groups, package_name, verbose) + else: + common.write_docbook('.', flags, groups, package_name) + + sys.exit(0) + +if __name__ == "__main__": + args = common.parse_me_args() + main(args['action'], + args['file'], + args['format'], + args['repo'], + args['verbose'], + args['name'], + args['test']) diff --git a/autogenerate-config-docs/common.py b/autogenerate-config-docs/common.py new file mode 100644 index 00000000..cbee3839 --- /dev/null +++ b/autogenerate-config-docs/common.py @@ -0,0 +1,400 @@ +# +# A collection of shared functions for managing help flag mapping files. +# + +import os +import sys +import pkgutil +import glob + +from collections import defaultdict +from xml.sax.saxutils import escape +from oslo.config import cfg + +# gettext internationalisation function requisite: +import __builtin__ +__builtin__.__dict__['_'] = lambda x: x + + +def git_check(repo_path): + from git import Repo + """ + Check a passed directory to verify it is a valid git repository. + """ + try: + repo = Repo(repo_path) + assert repo.bare is False + package_name = os.path.basename(repo.remotes.origin.url).rstrip('.git') + except: + print "\nThere is a problem verifying that the directory passed in" + print "is a valid git repoistory. Please try again.\n" + sys.exit(1) + return package_name + + +def populate_groups(filepath): + """ + Takes a file formatted with lines of config option and group + separated by a space and constructs a dictionary indexed by + group, which is returned.. + """ + groups = defaultdict(list) + groups_file = open(os.path.expanduser(filepath), 'r') + for line in groups_file: + try: + option, group = line.split(None, 1) + except ValueError: + print "Couldn't read groups file line:%s" % line + print "Check for formatting errors - did you add the group?" + sys.exit(1) + groups[group.strip()].append(option) + return groups + + +def extract_flags(repo_location, module_name, verbose=0, names_only=True): + """ + Loops through the repository, importing module by module to + populate the configuration object (cfg.CONF) created from Oslo. + """ + usable_dirs = [] + module_location = os.path.dirname(repo_location + '/' + module_name) + for root, dirs, files in os.walk(module_location + '/' + module_name): + for name in dirs: + abs_path = os.path.join(root.split(module_location)[1][1:], name) + if ('/tests' not in abs_path and '/locale' not in abs_path and + '/cmd' not in abs_path and '/db/migration' not in abs_path and + '/transfer' not in abs_path): + usable_dirs.append(os.path.join(root.split(module_location)[1][1:], name)) + + for directory in usable_dirs: + for python_file in glob.glob(module_location + '/' + directory + "/*.py"): + if '__init__' not in python_file: + usable_dirs.append(os.path.splitext(python_file)[0][len(module_location) + 1:]) + + package_name = directory.replace('/', '.') + try: + __import__(package_name) + if verbose >= 1: + print "imported %s" % package_name + + except ImportError as e: + """ + work around modules that don't like being imported in this way + FIXME This could probably be better, but does not affect the + configuration options found at this stage + """ + if verbose >= 2: + print str(e) + print "Failed to import: %s (%s)" % (package_name, e) + + continue + + flags = cfg.CONF._opts.items() + + #extract group information + for group in cfg.CONF._groups.keys(): + flags = flags + cfg.CONF._groups[group]._opts.items() + flags.sort() + + return flags + + +def extract_flags_test(repo_loc, module, verbose=0): + """ + TEST TEST TEST TEST TEST TEST + TEST TEST TEST TEST TEST TEST + Loops through the repository, importing module by module to + populate the configuration object (cfg.CONF) created from Oslo. + TEST TEST TEST TEST TEST TEST + TEST TEST TEST TEST TEST TEST + """ + flag_data = {} + flag_files = [] + usable_dirs = [] + module_location = os.path.dirname(repo_loc + '/' + module) + for root, dirs, files in os.walk(module_location + '/' + module): + for name in dirs: + abs_path = os.path.join(root.split(module_location)[1][1:], name) + if ('/tests' not in abs_path and '/locale' not in abs_path and + '/cmd' not in abs_path and '/db/migration' not in abs_path): + usable_dirs.append(os.path.join(root.split(module_location)[1][1:], name)) + + for directory in usable_dirs: + for python_file in glob.glob(module_location + '/' + directory + "/*.py"): + if '__init__' not in python_file: + usable_dirs.append(os.path.splitext(python_file)[0][len(module_location) + 1:]) + + package_name = directory.replace('/', '.') + try: + __import__(package_name) + if verbose >= 1: + print "imported %s" % package_name + flag_data[str(package_name)] = sorted(cfg.CONF._opts.items()) + + except ImportError as e: + """ + work around modules that don't like being imported in this way + FIXME This could probably be better, but does not affect the + configuration options found at this stage + """ + if verbose >= 2: + print str(e) + print "Failed to import: %s (%s)" % (package_name, e) + + continue + + return flag_data + + +def write_test(file, repo_dir, pkg_name): + """ + """ + file1 = file + ".test" + flags = extract_flags_test(repo_dir, pkg_name) + with open(file1, 'a+') as f: + f.write("\n") + for filename, flag_info in flags.iteritems(): + f.write("\n -- start file name area --\n") + f.write(filename) + f.write("\n -- end file name area --\n") + print "\n -- start file name area --\n" + print filename + print "\n -- end file name area --\n" + print len(flag_info) + for name, value in flag_info: + opt = value['opt'] + #print type(opt) + #print opt + #print name + #print value + f.write(name) + f.write("\n") + + +def write_header(filepath, verbose=0): + """ + Write header to output flag file. + """ + pass + + +def write_buffer(file, flags, verbose=0): + """ + Write flag data to file. (The header is written with the write_header function.) + """ + pass + #with open(os.path.expanduser(filepath), 'wb') as f: + + +def write_flags(filepath, flags, name_only=True, verbose=0): + """ + write out the list of flags in the cfg.CONF object to filepath + if name_only is True - write only a list of names, one per line, + otherwise use MediaWiki syntax to write out the full table with + help text and default values. + """ + with open(os.path.expanduser(filepath), 'wb') as f: + if not name_only: + f.write("{|\n") # start table + # print headers + f.write("!") + f.write("!!".join(["name", "default", "description"])) + f.write("\n|-\n") + + for name, value in flags: + opt = value['opt'] + if not opt.help: + opt.help = "No help text available for this option" + if not name_only: + f.write("|") + f.write("||".join([name, + str(opt.default), + opt.help.replace("\n", " ")])) + f.write("\n|-\n") + else: + f.write(name + "\n") + + if not name_only: + f.write("|}\n") # end table + + +def write_docbook(directory, flags, groups, package_name, verbose=0): + """ + Prints a docbook-formatted table for every group of options. + """ + count = 0 + for group in groups.items(): + groups_file = open(package_name + '-' + group[0] + '.xml', 'w') + groups_file.write('\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + ') + for flag_name in group[1]: + for flag in flags: + if flag[0] == flag_name: + count = count + 1 + opt = flag[1]["opt"] + if not opt.help: + opt.help = "No help text available for this option" + if type(opt).__name__ == "ListOpt" and opt.default is not None: + opt.default = ",".join(opt.default) + groups_file.write('\n \n\ + \n\ + \n\ + ') + groups_file.write('\n \n\ +
Description of configuration options for ' + group[0] + + '
Configuration option=Default value(Type) Description
' + flag_name + '=' + str(opt.default) + '(' + type(opt).__name__ + ') ' + + escape(opt.help) + '
\n\ +
') + groups_file.close() + + +def create(flag_file, repo_path): + """ + Create new flag mappings file, containing help information for + the project whose repo location has been passed in at the command line. + """ + + # flag_file testing. + #try: + # Test for successful creation of flag_file. + #except: + # If the test(s) fail, exit noting the problem(s). + + # repo_path git repo validity testing. + #try: + # Test to be sure the repo_path passed in is a valid directory + # and that directory is a valid existing git repo. + #except: + # If the test(s) fail, exit noting the problem(s). + + # get as much help as possible, searching recursively through the + # entire repo source directory tree. + #help_data = get_help(repo_path) + + # Write this information to the file. + #write_file(flag_file, help_data) + + +def update(filepath, flags, name_only=True, verbose=0): + """ + Update flag mappings file, adding or removing entries as needed. + This will update the file content, essentially overriding the data. + The primary difference between create and update is that create will + make a new file, and update will just work with the data that is + data that is already there. + """ + original_flags = [] + updated_flags = [] + write_flags(filepath + '.new', flags, name_only=True, verbose=0) + original_flag_file = open(filepath) + updated_flag_file = open(filepath + '.new', 'r') + for line in original_flag_file: + original_flags.append(line.split()[0]) + for line in updated_flag_file: + updated_flags.append(line.rstrip()) + updated_flag_file.close() + + removed_flags = set(original_flags) - set(updated_flags) + added_flags = set(updated_flags) - set(original_flags) + + print "\nRemoved Flags\n" + for line in sorted(removed_flags): + print line + + print "\nAdded Flags\n" + for line in sorted(added_flags): + print line + + updated_flag_file = open(filepath + '.new', 'wb') + original_flag_file.seek(0) + for line in original_flag_file: + flag_name = line.split()[0] + if flag_name not in removed_flags: + for added_flag in added_flags: + if flag_name > added_flag: + updated_flag_file.write(added_flag + ' Unknown\n') + added_flags.remove(added_flag) + break + updated_flag_file.write(line) + + +def verify(flag_file): + """ + Verify flag file contents. No actions are taken. + """ + pass + + +def usage(): + print "\nUsage: %s docbook " % sys.argv[0] + print "\nGenerate a list of all flags for package in source loc and"\ + "\nwrites them in a docbook table format, grouped by the groups"\ + "\nin the groups file, one file per group.\n" + print "\n %s names " % sys.argv[0] + print "\nGenerate a list of all flags names for the package in"\ + "\nsource loc and writes them to names file, one per line \n" + + +def parse_me_args(): + import argparse + parser = argparse.ArgumentParser( + description='Manage flag files, to aid in updatingdocumentation.', + epilog='Example: %(prog)s -a create -in ./nova.flagfile -fmt docbook\ + -p /nova', + usage='%(prog)s [options]') + parser.add_argument('-a', '--action', + choices=['create', 'update', 'verify'], + dest='action', + help='action (create, update, verify) [REQUIRED]', + required=True, + type=str,) + # trying str data type... instead of file. + parser.add_argument('-i', '-in', '--input', + dest='file', + help='flag file being worked with [REQUIRED]', + required=True, + type=str,) + parser.add_argument('-f', '-fmt', '--format', '-o', '-out', + dest='format', + help='file output format (options: docbook, names)', + required=False, + type=str,) + # ..tried having 'dir' here for the type, but the git.Repo function + # requires a string is passed to it.. a directory won't work. + parser.add_argument('-p', '--path', + dest='repo', + help='path to valid git repository [REQUIRED]', + required=True, + type=str,) + parser.add_argument('-v', '--verbose', + action='count', + default=0, + dest='verbose', + required=False,) + parser.add_argument('-no', '--name_only', + action='store_true', + dest='name', + help='whether output should contain names only', + required=False,) + parser.add_argument('-test', + action='store_true', + dest='test', + help=argparse.SUPPRESS, + required=False,) + args = vars(parser.parse_args()) + return args diff --git a/autogenerate-config-docs/flagmappings/ceilometer.flagmappings b/autogenerate-config-docs/flagmappings/ceilometer.flagmappings new file mode 100644 index 00000000..cff6b8f7 --- /dev/null +++ b/autogenerate-config-docs/flagmappings/ceilometer.flagmappings @@ -0,0 +1,142 @@ +admin_password keystone_authtoken +admin_tenant_name keystone_authtoken +admin_token keystone_authtoken +admin_user keystone_authtoken +allowed_rpc_exception_modules +auth_admin_prefix +auth_host keystone_authtoken +auth_port keystone_authtoken +auth_protocol keystone_authtoken +auth_strategy DEFAULT +auth_uri keystone_authtoken +auth_version keystone_authtoken +backdoor_port DEFAULT +backend database +cache +certfile keystone_authtoken +cinder_control_exchange DEFAULT +connection database +connection_debug database +connection_trace database +control_exchange DEFAULT +counter_source DEFAULT +database_connection DEFAULT +debug logging +default_log_levels logging +default_notification_level logging +default_publisher_id DEFAULT +delay_auth_decision +disable_process_locking +enable_v1_api DEFAULT +fake_rabbit +fatal_deprecations +glance_control_exchange DEFAULT +host +host +host +http_connect_timeout +http_handler +hypervisor_inspector +idle_timeout +instance_format +instance_uuid_format +keyfile keystone_authtoken +kombu_ssl_ca_certs +kombu_ssl_certfile +kombu_ssl_keyfile +kombu_ssl_version +libvirt_type +libvirt_uri +list_notifier_drivers +lock_path +log_config logging +log_date_format logging +log_dir logging +log_file logging +log_format logging +logging_context_format_string logging +logging_debug_format_suffix logging +logging_default_format_string logging +logging_exception_prefix logging +matchmaker_heartbeat_freq +matchmaker_heartbeat_ttl +max_overflow +max_pool_size +max_retries +memcache_secret_key +memcache_security_strategy +memcache_servers +memcached_servers +metering_secret DEFAULT +metering_topic DEFAULT +min_pool_size database +mysql_engine database +notification_driver +notification_topics +nova_control_exchange DEFAULT +os_auth_url service_credentials +os_password service_credentials +os_tenant_id service_credentials +os_tenant_name service_credentials +os_username service_credentials +password +pipeline_cfg_file +policy_default_rule +policy_file +pool_timeout +port +port +publish_errors +qpid_heartbeat qpid +qpid_hostname qpid +qpid_hosts qpid +qpid_password qpid +qpid_port qpid +qpid_protocol qpid +qpid_sasl_mechanisms qpid +qpid_tcp_nodelay qpid +qpid_username qpid +quantum_control_exchange DEFAULT +rabbit_durable_queues rabbitmq +rabbit_ha_queues rabbitmq +rabbit_host rabbitmq +rabbit_hosts rabbitmq +rabbit_max_retries rabbitmq +rabbit_password rabbitmq +rabbit_port rabbitmq +rabbit_retry_backoff rabbitmq +rabbit_retry_interval rabbitmq +rabbit_use_ssl rabbitmq +rabbit_userid rabbitmq +rabbit_virtual_host rabbitmq +reseller_prefix DEFAULT +reserved_metadata_length +reserved_metadata_namespace +retry_interval +revocation_cache_time +ringfile +rpc_backend rpc +rpc_cast_timeout rpc +rpc_conn_pool_size rpc +rpc_response_timeout rpc +rpc_thread_pool_size rpc +rpc_zmq_bind_address rpc +rpc_zmq_contexts rpc +rpc_zmq_host rpc +rpc_zmq_ipc_dir rpc +rpc_zmq_matchmaker rpc +rpc_zmq_port rpc +rpc_zmq_topic_backlog rpc +signing_dir keystone_authtoken +slave_connection +sqlite_db database +sqlite_synchronous database +syslog_log_facility +token_cache_time +topics +udp_address +udp_port +use_stderr +use_syslog +use_tpool database +verbose logging diff --git a/autogenerate-config-docs/flagmappings/cinder.flagmappings b/autogenerate-config-docs/flagmappings/cinder.flagmappings new file mode 100644 index 00000000..8e9292fb --- /dev/null +++ b/autogenerate-config-docs/flagmappings/cinder.flagmappings @@ -0,0 +1,297 @@ +allowed_rpc_exception_modules rpc +amqp_rpc_single_reply_queue rpc +api_paste_config api +api_rate_limit api +auth_strategy auth +available_devices storage +backdoor_port api +backend storage +backlog log +backup_api_class backups +backup_ceph_chunk_size backups +backup_ceph_conf backups +backup_ceph_pool backups +backup_ceph_stripe_count backups +backup_ceph_stripe_unit backups +backup_ceph_user backups +backup_driver backups +backup_manager backups +backup_name_template backups +backup_topic backups +bindir storage +capacity_weight_multiplier storage +cinder_huawei_conf_file storage +cloned_volume_same_az zones +connection connection +connection_debug connection +connection_trace connection +connection_type connection +control_exchange rpc +coraid_esm_address storage +coraid_group storage +coraid_password storage +coraid_repository_key storage +coraid_user storage +db_backend database +db_driver database +debug common +default_log_levels common +default_notification_level common +default_publisher_id common +default_volume_type common +disable_process_locking common +enable_new_services common +enable_v1_api api +enable_v2_api api +enabled_backends storage +fake_rabbit rpc +fatal_deprecations common +fatal_exception_format_errors common +glance_api_insecure images +glance_api_servers images +glance_api_ssl_compression images +glance_api_version images +glance_host images +glance_num_retries images +glance_port images +glusterfs_disk_util storage +glusterfs_mount_point_base storage +glusterfs_shares_config storage +glusterfs_sparsed_volumes storage +gpfs_images_dir images +gpfs_images_share_mode images +gpfs_max_clone_depth images +gpfs_mount_point_base images +gpfs_sparse_volumes images +hds_cinder_config_file storage +host common +host common +idle_timeout common +iet_conf common +image_conversion_dir images +instance_format images +instance_uuid_format images +iscsi_helper storage +iscsi_iotype storage +iscsi_ip_address storage +iscsi_num_targets storage +iscsi_port storage +iscsi_target_prefix storage +kombu_ssl_ca_certs rpc +kombu_ssl_certfile rpc +kombu_ssl_keyfile rpc +kombu_ssl_version rpc +lio_initiator_iqns common +lock_path common +log_config common +log_date_format common +log_dir common +log_file common +log_format common +logging_context_format_string common +logging_debug_format_suffix common +logging_default_format_string common +logging_exception_prefix common +lvm_mirrors storage +matchmaker_heartbeat_freq rpc +matchmaker_heartbeat_ttl rpc +matchmaker_ringfile rpc +max_age storage +max_gigabytes storage +max_overflow storage +max_pool_size storage +max_retries storage +memcached_servers storage +migration_create_volume_timeout_secs storage +min_pool_size storage +monkey_patch common +monkey_patch_modules common +my_ip common +netapp_login storage +netapp_password storage +netapp_server_hostname storage +netapp_server_port storage +netapp_size_multiplier storage +netapp_storage_family storage +netapp_storage_protocol storage +netapp_transport_type storage +netapp_vfiler storage +netapp_volume_list storage +netapp_vserver storage +nexenta_blocksize storage +nexenta_host storage +nexenta_iscsi_target_portal_port storage +nexenta_password storage +nexenta_rest_port storage +nexenta_rest_protocol storage +nexenta_sparse storage +nexenta_target_group_prefix storage +nexenta_target_prefix storage +nexenta_user storage +nexenta_volume storage +nfs_mount_options storage +nfs_mount_point_base storage +nfs_oversub_ratio storage +nfs_shares_config storage +nfs_sparsed_volumes storage +nfs_used_ratio storage +no_snapshot_gb_quota common +notification_driver rpc +notification_topics rpc +num_iscsi_scan_tries common +num_shell_tries common +osapi_max_limit api +osapi_max_request_body_size api +osapi_volume_base_URL api +osapi_volume_ext_list api +osapi_volume_extension api +password common +policy_default_rule common +policy_file common +pool_size common +port common +publish_errors rpc +pybasedir common +qpid_heartbeat rpc +qpid_hostname rpc +qpid_hosts rpc +qpid_password rpc +qpid_port rpc +qpid_protocol rpc +qpid_sasl_mechanisms rpc +qpid_tcp_nodelay rpc +qpid_username rpc +quota_driver common +quota_gigabytes common +quota_snapshots common +quota_volumes common +rabbit_durable_queues rpc +rabbit_ha_queues rpc +rabbit_host rpc +rabbit_hosts rpc +rabbit_max_retries rpc +rabbit_password rpc +rabbit_port rpc +rabbit_retry_backoff rpc +rabbit_retry_interval rpc +rabbit_use_ssl rpc +rabbit_userid rpc +rabbit_virtual_host rpc +rbd_ceph_conf storage +rbd_flatten_volume_from_snapshot storage +rbd_pool storage +rbd_secret_uuid storage +rbd_user storage +reservation_expire common +reserved_percentage common +retry_interval common +root_helper common +rootwrap_config common +rpc_backend rpc +rpc_cast_timeout rpc +rpc_conn_pool_size rpc +rpc_response_timeout rpc +rpc_thread_pool_size rpc +rpc_zmq_bind_address rpc +rpc_zmq_contexts rpc +rpc_zmq_host rpc +rpc_zmq_ipc_dir rpc +rpc_zmq_matchmaker rpc +rpc_zmq_port rpc +rpc_zmq_topic_backlog rpc +run_external_periodic_tasks common +san_clustername storage +san_ip storage +san_is_local storage +san_login storage +san_password storage +san_private_key storage +san_ssh_port storage +san_thin_provision storage +san_zfs_volume_base storage +scality_sofs_config storage +scality_sofs_mount_point storage +scality_sofs_volume_dir storage +scheduler_default_filters scheduler +scheduler_default_weighers scheduler +scheduler_driver scheduler +scheduler_host_manager scheduler +scheduler_json_config_location scheduler +scheduler_manager scheduler +scheduler_max_attempts scheduler +scheduler_topic scheduler +service_down_time common +sf_account_prefix storage +sf_allow_tenant_qos storage +sf_emulate_512 storage +snapshot_name_template backup +snapshot_same_host backup +sqlite_db common +sqlite_synchronous common +ssh_conn_timeout common +ssh_max_pool_conn common +ssh_min_pool_conn common +ssl_ca_file common +ssl_cert_file common +ssl_key_file common +state_path common +storage_availability_zone common +storwize_svc_connection_protocol storage +storwize_svc_flashcopy_timeout storage +storwize_svc_multihostmap_enabled storage +storwize_svc_multipath_enabled storage +storwize_svc_vol_autoexpand storage +storwize_svc_vol_compression storage +storwize_svc_vol_easytier storage +storwize_svc_vol_grainsize storage +storwize_svc_vol_rsize storage +storwize_svc_vol_warning storage +storwize_svc_volpool_name storage +syslog_log_facility common +tcp_keepidle common +topics common +transfer_api_class api +until_refresh common +use_default_quota_class common +use_forwarded_for common +use_multipath_for_image_xfer images +use_stderr common +use_syslog common +use_tpool common +verbose common +volume_api_class api +volume_backend_name storage +volume_clear storage +volume_clear_size storage +volume_dd_blocksize storage +volume_driver storage +volume_group storage +volume_manager storage +volume_name_template storage +volume_tmp_dir storage +volume_topic storage +volume_transfer_key_length storage +volume_transfer_salt_length storage +volume_usage_audit_period storage +volumes_dir storage +windows_iscsi_lun_path storage +xenapi_connection_password api +xenapi_connection_url api +xenapi_connection_username api +xenapi_nfs_server api +xenapi_nfs_serverpath api +xenapi_sr_base_path api +xiv_proxy storage +zadara_default_cache_policy storage +zadara_default_encryption storage +zadara_default_stripesize storage +zadara_default_striping_mode storage +zadara_password storage +zadara_user storage +zadara_vol_name_template storage +zadara_vpsa_allow_nonexistent_delete storage +zadara_vpsa_auto_detach_on_delete storage +zadara_vpsa_ip storage +zadara_vpsa_poolname storage +zadara_vpsa_port storage +zadara_vpsa_use_ssl storage diff --git a/autogenerate-config-docs/flagmappings/glance.flagmappings b/autogenerate-config-docs/flagmappings/glance.flagmappings new file mode 100644 index 00000000..f615bf73 --- /dev/null +++ b/autogenerate-config-docs/flagmappings/glance.flagmappings @@ -0,0 +1,131 @@ +admin_password registry +admin_role api +admin_tenant_name registry +admin_user registry +allow_additional_image_properties common +allow_anonymous_access api +api_limit_max common +auth_region registry +auth_strategy registry +auth_url registry +backlog common +bind_host common +bind_port common +ca_file ssl +cert_file ssl +cleanup_scrubber imagecache +cleanup_scrubber_time imagecache +config_file paste +data_api common +db_auto_create api +debug logging +default_log_levels loggin +default_store api +delayed_delete imagecache +enable_v1_api api +enable_v2_api api +fatal_deprecations logging +filesystem_store_datadir filesystem +flavor paste +image_cache_dir imagecache +image_cache_driver imagecache +image_cache_max_size imagecache +image_cache_sqlite_db imagecache +image_cache_stall_time imagecache +image_size_cap api +instance_format logging +instance_uuid_format logging +key_file ssl +known_stores api +limit_param_default common +log_config logging +log_date_format logging +log_dir logging +log_file logging +log_format logging +logfile_mode logging +logging_context_format_string logging +logging_debug_format_suffix logging +logging_default_format_string logging +logging_exception_prefix logging +metadata_encryption_key common +notifier_strategy common +owner_is_tenant api +policy_default_rule policy +policy_file policy +publish_errors logging +pydev_worker_debug_host testing +pydev_worker_debug_port testing +qpid_heartbeat qpid +qpid_hostname qpid +qpid_notification_exchange qpid +qpid_notification_topic qpid +qpid_password qpid +qpid_port qpid +qpid_protocol qpid +qpid_reconnect_interval qpid +qpid_reconnect_interval_max qpid +qpid_reconnect_interval_min qpid +qpid_reconnect_limit qpid +qpid_reconnect_timeout qpid +qpid_sasl_mechanisms qpid +qpid_tcp_nodelay qpid +qpid_username qpid +rabbit_durable_queues rabbitmq +rabbit_host rabbitmq +rabbit_max_retries rabbitmq +rabbit_notification_exchange rabbitmq +rabbit_notification_topic rabbitmq +rabbit_password rabbitmq +rabbit_port rabbitmq +rabbit_retry_backoff rabbitmq +rabbit_retry_max_backoff rabbitmq +rabbit_use_ssl rabbitmq +rabbit_userid rabbitmq +rabbit_virtual_host rabbitmq +rbd_store_ceph_conf rbd +rbd_store_chunk_size rbd +rbd_store_pool rbd +rbd_store_user rbd +registry_client_ca_file registry +registry_client_cert_file registry +registry_client_insecure registry +registry_client_key_file registry +registry_client_protocol registry +registry_client_timeout registry +registry_host registry +registry_port registry +s3_store_access_key s3 +s3_store_bucket s3 +s3_store_bucket_url_format s3 +s3_store_create_bucket_on_put s3 +s3_store_host s3 +s3_store_object_buffer_dir s3 +s3_store_secret_key s3 +scrub_time imagecache +scrubber_datadir imagecache +show_image_direct_url common +sql_connection db +sql_idle_timeout db +sql_max_retries db +sql_retry_interval db +swift_enable_snet swift +swift_store_admin_tenants swift +swift_store_auth_address swift +swift_store_auth_version swift +swift_store_container swift +swift_store_create_container_on_put swift +swift_store_endpoint_type swift +swift_store_key swift +swift_store_large_object_chunk_size swift +swift_store_large_object_size swift +swift_store_multi_tenant swift +swift_store_region swift +swift_store_service_type swift +swift_store_user swift +syslog_log_facility logging +tcp_keepidle wsgi +use_stderr logging +use_syslog logging +verbose logging +workers common diff --git a/autogenerate-config-docs/flagmappings/neutron.flagmappings b/autogenerate-config-docs/flagmappings/neutron.flagmappings new file mode 100644 index 00000000..67659154 --- /dev/null +++ b/autogenerate-config-docs/flagmappings/neutron.flagmappings @@ -0,0 +1,271 @@ +add_meta_server_route bigswitch +address brocade +admin_password common +admin_tenant_name common +admin_user common +agent_down_time agent +allow_bulk api +allow_overlapping_ips policy +allow_pagination api +allow_sorting api +allowed_rpc_exception_modules common +api_extensions_path api +api_paste_config api +auth_region common +auth_strategy common +auth_strategy metadata +auth_url common +backdoor_port testing +backend db +backlog wsgi +base_mac common +bind_host common +bind_port common +bridge_mappings openvswitch +cert_file nec +concurrent_connections nicira +connection db +connection_debug db +connection_trace db +control_exchange rpc +core_plugin common +daemon_endpoint mlnx +debug logging +default_flavor meta +default_interface_name nicira +default_l2_gw_service_uuid nicira +default_l3_flavor meta +default_l3_gw_service_uuid nicira +default_log_levels logging +default_notification_level notifier +default_publisher_id notifier +default_quota quotas +default_transport_type nicira +default_tz_uuid nicira +dhcp_agent_notification common +dhcp_agents_per_network db +dhcp_lease_duration common +director_server plumgrid +director_server_port plumgrid +disable_process_locking common +driver nec +driver_fqn lbaas +enable_metadata_access_network nicira +enable_packet_filter nec +enable_tunneling openvswitch +extension_map meta +external_pids agent +fake_rabbit testing +fatal_deprecations logging +firewall_driver securitygroups +flat_networks ml2 +force_gateway_on_subnet common +host cisco +host common +host nec +host rpc +http_timeout nicira +idle_timeout db +instance_format logging +instance_uuid_format logging +int_peer_patch_port openvswitch +integration_bridge openvswitch +key_file ssl +kombu_ssl_ca_certs kombu +kombu_ssl_certfile kombu +kombu_ssl_keyfile kombu +kombu_ssl_version kombu +l3_plugin_list meta +loadbalancer_pool_scheduler_driver lbaas +local_ip openvswitch +local_network_vswitch hyperv +lock_path common +log_config logging +log_date_format logging +log_dir logging +log_file logging +log_format logging +logging_context_format_string logging +logging_debug_format_suffix logging +logging_default_format_string logging +logging_exception_prefix logging +mac_generation_retries common +matchmaker_heartbeat_freq rpc +matchmaker_heartbeat_ttl rpc +max_dns_nameservers common +max_fixed_ips_per_port common +max_lp_per_bridged_ls nicira +max_lp_per_overlay_ls nicira +max_overflow db +max_pool_size db +max_retries db +max_router_rules bigswitch +max_routes quotas +max_subnet_host_routes common +mechanism_drivers ml2 +metadata_mode nicira +metadata_proxy_socket metadata +metadata_router_id metadata +midonet_uri midonet +min_pool_size db +mode midonet +model_class cisco +network_auto_schedule scheduler +network_scheduler_driver scheduler +network_vlan_ranges common +network_vlan_ranges hyperv +network_vlan_ranges openvswitch +neutron_id bigswitch +nexus_driver cisco +nexus_plugin cisco +node_override_vif_802.1qbg bigswitch +node_override_vif_802.1qbh bigswitch +node_override_vif_binding_failed bigswitch +node_override_vif_bridge bigswitch +node_override_vif_hyperv bigswitch +node_override_vif_ivs bigswitch +node_override_vif_other bigswitch +node_override_vif_ovs bigswitch +node_override_vif_unbound bigswitch +notification_driver notifier +notification_topics notifier +nvp_cluster_uuid nicira +nvp_controllers nicira +nvp_gen_timeout nicira +nvp_password nicira +nvp_user nicira +openflow_rest_api ryu +ostype brocade +ovsdb_interface ryu +ovsdb_ip ryu +ovsdb_port ryu +pagination_max_limit api +password brocade +password midonet +password plumgrid +password rpc +periodic_fuzzy_delay common +periodic_interval common +physical_interface brocade +physical_interface_mappings linuxbridge +physical_network_vswitch_mappings hyperv +plugin_list meta +policy_file policy +polling_interval hyperv +pool_timeout db +port nec +port rpc +project_id midonet +provider_router_id midonet +provider_vlan_aiuto_create cisco +provider_vlan_auto_trunk cisco +provider_vlan_name_prefix cisco +publish_errors logging +qpid_heartbeat qpid +qpid_hostname qpid +qpid_hosts qpid +qpid_password qpid +qpid_port qpid +qpid_protocol qpid +qpid_sasl_mechanisms qpid +qpid_tcp_nodelay qpid +qpid_username qpid +quota_driver quotas +quota_firewall quotas +quota_firewall_policy quotas +quota_firewall_rule quotas +quota_floatingip quotas +quota_items quotas +quota_network quotas +quota_network_gateway quotas +quota_packet_filter quotas +quota_port quotas +quota_router quotas +quota_security_group quotas +quota_security_group_rule quotas +quota_subnet quotas +rabbit_durable_queues rabbitmq +rabbit_ha_queues rabbitmq +rabbit_host rabbitmq +rabbit_hosts rabbitmq +rabbit_max_retries rabbitmq +rabbit_password rabbitmq +rabbit_port rabbitmq +rabbit_retry_backoff rabbitmq +rabbit_retry_interval rabbitmq +rabbit_use_ssl rabbitmq +rabbit_userid rabbitmq +rabbit_virtual_host rabbitmq +redirects nicira +report_interval agent +req_timeout ml2 +request_timeout mlnx +retries nicira +retry_intervali db +retry_until_window wsgi +ringfile rpc +root_helper common +router_auto_schedule scheduler +router_scheduler_driver scheduler +rpc_backend rpc +rpc_cast_timeout rpc +rpc_conn_pool_size rpc +rpc_response_timeout rpc +rpc_support_old_agents rpc +rpc_thread_pool_size rpc +rpc_zmq_bind_address zeromq +rpc_zmq_contexts zeromq +rpc_zmq_host zeromq +rpc_zmq_ipc_dir zeromq +rpc_zmq_matchmaker zeromq +rpc_zmq_port zeromq +rpc_zmq_topic_backlog zeromq +run_external_periodic_tasks api +server_auth bigswitch +server_ssl bigswitch +server_timeout bigswitch +servers bigswitch +servertimeout plumgrid +service_plugins api +service_provider api +slave_connection db +sqlite_db db +sqlite_synchronous db +ssl_ca_file ssl +ssl_cert_file ssl +ssl_key_file ssl +state_path common +supported_extension_aliases meta +svi_round_robin cisco +sync_data bigswitch +syslog_log_facility logging +tcp_keepidle wsgi +tenant_default_router_rule bigswitch +tenant_network_type hyperv +tenant_network_type linuxbridge +tenant_network_type openvswitch +tenant_network_types ml2 +topics rpc +tun_peer_patch_port openvswitch +tunnel_bridge openvswitch +tunnel_id_ranges openvswitch +tunnel_interface ryu +tunnel_ip ryu +tunnel_key_max ryu +tunnel_key_min ryu +tunnel_type openvswitch +tunnel_types openvswitch +type_drivers ml2 +use_ssl nec +use_ssl ssl +use_stderr logging +use_syslog logging +use_tpool db +username brocade +username midonet +username plumgrid +verbose logging +vif_type bigswitch +vlan_name_prefix cisco +vnic_type mlnx +vswitch_plugin cisco diff --git a/autogenerate-config-docs/flagmappings/nova.flagmappings b/autogenerate-config-docs/flagmappings/nova.flagmappings new file mode 100644 index 00000000..ad7a32ab --- /dev/null +++ b/autogenerate-config-docs/flagmappings/nova.flagmappings @@ -0,0 +1,607 @@ +address zookeeper +agent_enabled spice +agent_resetnetwork_timeout xen +agent_timeout xen +agent_version_timeout xen +allow_instance_snapshots policy +allow_migrate_to_same_host policy +allow_resize_to_same_host policy +allow_same_net_traffic network +allowed_direct_url_schemes glance +allowed_rpc_exception_modules testing +api_paste_config wsgi +api_rate_limit authentication +attestation_api_url trustedcomputing +attestation_auth_blob trustedcomputing +attestation_auth_timeout trustedcomputing +attestation_port trustedcomputing +attestation_server trustedcomputing +attestation_server_ca_file trustedcomputing +auth_strategy authentication +auto_assign_floating_ip network +backdoor_port testing +bandwidth_poll_interval quota +bandwidth_update_interval quota +base_dir_name compute +baseapi rpc +bindir common +block_device_creation_timeout volumes +block_migration_flag hypervisor +boot_script_template vpn +buckets_path s3 +ca_file ca +ca_path ca +cache_images xen +call_timeout cells +capabilities cells +cell_type cells +cells upgrade_levels +cells_config cells +cert upgrade_levels +cert_manager ca +cert_topic ca +checksum_base_images hypervisor +checksum_interval_seconds compute +cinder_api_insecure volumes +cinder_ca_certificates_file volumes +cinder_catalog_info volumes +cinder_cross_az_attach volumes +cinder_endpoint_template volumes +cinder_http_retries volumes +cnt_vpn_clients network +compute upgrade_levels +compute_api_class compute +compute_driver compute +compute_manager compute +compute_stats_class compute +compute_topic common +conductor upgrade_levels +config_drive_cdrom configdrive +config_drive_format configdrive +config_drive_inject_password configdrive +config_drive_skip_versions configdrive +config_drive_tempdir configdrive +console upgrade_levels +console_driver xen +console_host compute +console_manager compute +console_public_hostname console +console_token_ttl console +console_topic common +console_vmrc_error_retries xen +console_vmrc_port xen +console_xvp_conf xen +console_xvp_conf_template xen +console_xvp_log xen +console_xvp_multiplex_port xen +console_xvp_pid xen +consoleauth upgrade_levels +consoleauth_manager console +consoleauth_topic common +control_exchange rpc +cpu_allocation_ratio scheduling +create_unique_mac_address_attempts network +crl_file ca +db_backend baremetal +db_backend db +db_check_interval db +db_driver db +dbapi_use_tpool db +debug logging +default_access_ip_network_name network +default_availability_zone availabilityzones +default_ephemeral_format hypervisor +default_flavor compute +default_floating_pool network +default_log_levels logging +default_notification_level compute +default_os_type xen +default_publisher_id compute +default_schedule_zone availabilityzones +defer_iptables_apply network +deploy_kernel baremetal +deploy_ramdisk baremetal +dhcp_domain network +dhcp_lease_time network +dhcpbridge network +dhcpbridge_flagfile network +disable_process_locking common +disk_allocation_ratio scheduling +disk_cachemodes hypervisor +dmz_cidr vpn +dmz_mask vpn +dmz_net vpn +dns_server network +dns_update_periodic_interval network +dnsmasq_config_file network +driver baremetal +driver cells +ec2_dmz_host ec2 +ec2_host ec2 +ec2_listen ec2 +ec2_listen_port ec2 +ec2_path ec2 +ec2_port ec2 +ec2_private_dns_show_ip ec2 +ec2_scheme ec2 +ec2_strict_validation ec2 +ec2_timestamp_expiry ec2 +ec2_workers ec2 +enable cells +enable_instance_password compute +enable_network_quota quota +enable_new_services api +enabled spice +enabled v3api +enabled_apis api +enabled_ssl_apis api +extensions_blacklist apiv3 +extensions_whitelist apiv3 +fake_call testing +fake_network testing +fake_rabbit testing +fatal_deprecations logging +fatal_exception_format_errors logging +firewall_driver network +fixed_ip_disassociate_timeout network +fixed_range network +fixed_range_v6 ipv6 +flat_injected network +flat_interface network +flat_network_bridge network +flat_network_dns network +floating_ip_dns_manager network +force_config_drive configdrive +force_dhcp_release network +force_raw_images hypervisor +force_snat_range network +force_volumeutils_v1 volumes +forward_bridge_interface network +fping_path fping +gateway network +gateway_v6 ipv6 +glance_api_insecure glance +glance_api_servers glance +glance_host glance +glance_num_retries glance +glance_port glance +glance_protocol glance +glusterfs_mount_point_base volumes +heal_instance_info_cache_interval compute +host common +host redis +host_state_interval compute +html5proxy_base_url spice +image_cache_manager_interval compute +image_decryption_dir s3 +image_info_filename_pattern compute +inject_password hypervisor +injected_network_template network +injected_network_template network +instance_build_timeout compute +instance_dns_domain network +instance_dns_manager network +instance_format logging +instance_name_template api +instance_type_extra_specs baremetal +instance_update_num_instances cells +instance_updated_at_threshold cells +instance_usage_audit compute +instance_usage_audit_period compute +instance_uuid_format logging +instances_path compute +instances_path_share hyperv +integration_bridge vmware +intercell upgrade_levels +internal_service_availability_zone availabilityzones +ipmi_power_retry baremetal +iptables_bottom_regex network +iptables_drop_action network +iptables_top_regex network +ipv6_backend ipv6 +iqn_prefix xen +iscsi_iqn_prefix volumes +isolated_hosts scheduling +isolated_images scheduling +key_file ca +keymap spice +keymgr_api_class keymgr +keys_path ca +keystone_ec2_url ec2 +kombu_ssl_ca_certs kombu +kombu_ssl_certfile kombu +kombu_ssl_keyfile kombu +kombu_ssl_version kombu +l3_lib network +ldap_dns_base_dn ldap +ldap_dns_password ldap +ldap_dns_servers ldap +ldap_dns_soa_expiry ldap +ldap_dns_soa_hostmaster ldap +ldap_dns_soa_minimum ldap +ldap_dns_soa_refresh ldap +ldap_dns_soa_retry ldap +ldap_dns_url ldap +ldap_dns_user ldap +libvirt_cpu_mode hypervisor +libvirt_cpu_model hypervisor +libvirt_disk_prefix hypervisor +libvirt_images_type hypervisor +libvirt_images_volume_group hypervisor +libvirt_inject_key hypervisor +libvirt_inject_partition hypervisor +libvirt_inject_password hypervisor +libvirt_iscsi_use_multipath hypervisor +libvirt_lvm_snapshot_size hypervisor +libvirt_nonblocking hypervisor +libvirt_ovs_bridge hypervisor +libvirt_snapshot_compression hypervisor +libvirt_snapshots_directory hypervisor +libvirt_sparse_logical_volumes hypervisor +libvirt_type hypervisor +libvirt_uri hypervisor +libvirt_use_virtio_for_bridges hypervisor +libvirt_vif_driver hypervisor +libvirt_volume_drivers hypervisor +libvirt_wait_soft_reboot_seconds hypervisor +limit_cpu_features hyperv +linuxnet_interface_driver network +linuxnet_ovs_integration_bridge network +live_migration_bandwidth livemigration +live_migration_flag livemigration +live_migration_retry_count livemigration +live_migration_uri livemigration +lock_path common +lockout_attempts ec2 +lockout_minutes ec2 +lockout_window ec2 +log_config logging +log_date_format logging +log_dir logging +log_file logging +log_format logging +logging_context_format_string logging +logging_debug_format_suffix logging +logging_default_format_string logging +logging_exception_prefix logging +manager cells +manager conductor +matchmaker_heartbeat_freq rpc +matchmaker_heartbeat_ttl rpc +max_age policy +max_hop_count cells +max_instances_per_host scheduling +max_io_ops_per_host scheduling +max_kernel_ramdisk_size xen +memcached_servers common +metadata_host metadata +metadata_listen metadata +metadata_listen_port metadata +metadata_manager metadata +metadata_port metadata +metadata_workers metadata +mkisofs_cmd configdrive +monkey_patch testing +monkey_patch_modules testing +multi_host network +multi_instance_display_name_template api +mute_child_interval cells +mute_weight_multiplier cells +mute_weight_value cells +my_ip common +name cells +net_config_template baremetal +network upgrade_levels +network_allocate_retries network +network_api_class network +network_device_mtu network +network_driver network +network_manager network +network_size network +network_topic network +networks_path network +neutron_admin_auth_url neutron +neutron_admin_password neutron +neutron_admin_tenant_name neutron +neutron_admin_username neutron +neutron_api_insecure neutron +neutron_auth_strategy neutron +neutron_default_tenant_id neutron +neutron_extension_sync_interval neutron +neutron_metadata_proxy_shared_secret neutron +neutron_ovs_bridge neutron +neutron_region_name neutron +neutron_url neutron +neutron_url_timeout neutron +nfs_mount_options volumes +nfs_mount_point_base volumes +non_inheritable_image_properties api +notification_driver common +notification_topics common +notify_api_faults common +notify_on_state_change common +novncproxy_base_url vnc +null_kernel api +num_aoe_discover_tries volumes +num_iscsi_scan_tries volumes +num_networks network +os_region_name volumes +osapi_compute_ext_list api +osapi_compute_extension api +osapi_compute_link_prefix api +osapi_compute_listen api +osapi_compute_listen_port api +osapi_compute_unique_server_name_scope policy +osapi_compute_workers api +osapi_glance_link_prefix glance +osapi_hide_server_address_states api +osapi_max_limit policy +osapi_max_request_body_size policy +password redis +password_length policy +periodic_enable periodic +periodic_fuzzy_delay periodic +policy_default_rule policy +policy_file policy +port redis +power_manager baremetal +powervm_img_local_path powervm +powervm_img_remote_path powervm +powervm_mgr powervm +powervm_mgr_passwd powervm +powervm_mgr_type powervm +powervm_mgr_user powervm +preallocate_images hypervisor +project_cert_subject ca +public_interface network +publish_errors logging +pxe_append_params baremetal +pxe_config_template baremetal +pxe_deploy_timeout baremetal +pxe_network_config baremetal +pybasedir common +qemu_img_cmd hyperv +qpid_heartbeat qpid +qpid_hostname qpid +qpid_hosts qpid +qpid_password qpid +qpid_port qpid +qpid_protocol qpid +qpid_sasl_mechanisms qpid +qpid_tcp_nodelay qpid +qpid_username qpid +quota_cores quota +quota_driver quota +quota_fixed_ips quota +quota_floating_ips quota +quota_injected_file_content_bytes quota +quota_injected_file_path_bytes quota +quota_injected_files quota +quota_instances quota +quota_key_pairs quota +quota_metadata_items quota +quota_ram quota +quota_security_group_rules quota +quota_security_groups quota +rabbit_durable_queues rabbitmq +rabbit_ha_queues rabbitmq +rabbit_host rabbitmq +rabbit_hosts rabbitmq +rabbit_max_retries rabbitmq +rabbit_password rabbitmq +rabbit_port rabbitmq +rabbit_retry_backoff rabbitmq +rabbit_retry_interval rabbitmq +rabbit_use_ssl rabbitmq +rabbit_userid rabbitmq +rabbit_virtual_host rabbitmq +ram_allocation_ratio scheduling +ram_weight_multiplier scheduling +rbd_secret_uuid volume +rbd_user volume +reboot_timeout compute +reclaim_instance_interval compute +recv_timeout zookeeper +region_list ec2 +remove_unused_base_images hypervisor +remove_unused_kernels hypervisor +remove_unused_original_minimum_age_seconds hypervisor +remove_unused_resized_minimum_age_seconds hypervisor +report_interval common +rescue_image_id hypervisor +rescue_kernel_id hypervisor +rescue_ramdisk_id hypervisor +rescue_timeout hypervisor +reservation_expire policy +reserve_percent cells +reserved_host_disk_mb scheduling +reserved_host_memory_mb scheduling +resize_confirm_window compute +resume_guests_state_on_host_boot compute +ringfile rpc +rootwrap_config common +routing_source_ip network +rpc_backend rpc +rpc_cast_timeout rpc +rpc_conn_pool_size rpc +rpc_driver_queue_base rpc +rpc_response_timeout rpc +rpc_thread_pool_size rpc +rpc_zmq_bind_address zeromq +rpc_zmq_contexts zeromq +rpc_zmq_host zeromq +rpc_zmq_ipc_dir zeromq +rpc_zmq_matchmaker zeromq +rpc_zmq_port zeromq +rpc_zmq_topic_backlog zeromq +run_external_periodic_tasks periodic +running_deleted_instance_action compute +running_deleted_instance_poll_interval compute +running_deleted_instance_timeout compute +s3_access_key s3 +s3_affix_tenant s3 +s3_host s3 +s3_listen s3 +s3_listen_port s3 +s3_port s3 +s3_secret_key s3 +s3_use_ssl s3 +scality_sofs_config volume +scality_sofs_mount_point volume +scheduler upgrade_levels +scheduler_available_filters scheduling +scheduler_default_filters scheduling +scheduler_driver scheduling +scheduler_filter_classes scheduling +scheduler_host_manager scheduling +scheduler_host_subset_size scheduling +scheduler_json_config_location scheduling +scheduler_manager scheduling +scheduler_max_attempts scheduling +scheduler_retries scheduling +scheduler_retry_delay scheduling +scheduler_topic scheduling +scheduler_weight_classes scheduling +security_group_api network +send_arp_for_ha network +send_arp_for_ha_count network +server_listen spice +server_proxyclient_address spice +service_down_time common +service_neutron_metadata_proxy neutron +servicegroup_driver api +sg_prefix zookeeper +sg_retry_interval zookeeper +share_dhcp_address network +shelved_offload_time compute +shelved_poll_interval compute +snapshot_image_format hypervisor +snapshot_name_template api +sql_connection baremetal +sql_connection db +sql_connection_debug db +sql_connection_trace db +sql_idle_timeout db +sql_max_overflow db +sql_max_pool_size db +sql_max_retries db +sql_min_pool_size db +sql_retry_interval db +sqlite_db db +sqlite_synchronous db +sr_matching_filter xen +ssl_ca_file wsgi +ssl_cert_file wsgi +ssl_key_file wsgi +state_path common +stub_compute xen +sync_power_state_interval compute +syslog_log_facility logging +target_host xen +target_port xen +tcp_keepidle wsgi +teardown_unused_network_gateway network +tempdir common +terminal baremetal +terminal_cert_dir baremetal +terminal_pid_dir baremetal +tftp_root baremetal +tile_pdu_ip tilera +tile_pdu_mgr tilera +tile_pdu_off tilera +tile_pdu_on tilera +tile_pdu_status tilera +tile_power_wait tilera +timeout_nbd hypervisor +topic cells +topic conductor +topics rpc +until_refresh policy +update_dns_entries network +use_cow_images hypervisor +use_forwarded_for api +use_ipv6 ipv6 +use_join_force xen +use_linked_clone vmware +use_local conductor +use_network_dns_servers network +use_neutron_default_nets network +use_project_ca ca +use_single_default_gateway network +use_stderr logging +use_syslog logging +use_unsafe_iscsi baremetal +use_usb_tablet hypervisor +user_cert_subject ca +vcpu_pin_set hypervisor +verbose logging +vif_driver baremetal +virt_mkfs hypervisor +virtual_power_host_key baremetal +virtual_power_host_pass baremetal +virtual_power_host_user baremetal +virtual_power_ssh_host baremetal +virtual_power_ssh_port baremetal +virtual_power_type baremetal +vlan_interface network +vlan_start network +vmwareapi_api_retry_count vmware +vmwareapi_cluster_name vmware +vmwareapi_host_ip vmware +vmwareapi_host_password vmware +vmwareapi_host_username vmware +vmwareapi_task_poll_interval vmware +vmwareapi_vlan_interface vmware +vmwareapi_wsdl_loc vmware +vnc_enabled vnc +vnc_keymap vnc +vnc_password vnc +vnc_port vnc +vnc_port_total vnc +vncserver_listen vnc +vncserver_proxyclient_address vnc +volume_api_class volumes +volume_attach_retry_count volumes +volume_attach_retry_interval volumes +volume_driver volumes +volume_usage_poll_interval volumes +vpn_flavor vpn +vpn_image_id vpn +vpn_ip vpn +vpn_key_suffix vpn +vpn_start vpn +vswitch_name hyperv +wsgi_log_format wsgi +xen_hvmloader_path xen +xenapi_agent_path xen +xenapi_check_host xen +xenapi_connection_concurrent xen +xenapi_connection_password xen +xenapi_connection_url xen +xenapi_connection_username xen +xenapi_disable_agent xen +xenapi_image_upload_handler xen +xenapi_login_timeout xen +xenapi_num_vbd_unplug_retries xen +xenapi_ovs_integration_bridge xen +xenapi_remap_vbd_dev xen +xenapi_remap_vbd_dev_prefix xen +xenapi_running_timeout xen +xenapi_sparse_copy xen +xenapi_sr_base_path xen +xenapi_torrent_base_url xen +xenapi_torrent_download_stall_cutoff xen +xenapi_torrent_images xen +xenapi_torrent_listen_port_end xen +xenapi_torrent_listen_port_start xen +xenapi_torrent_max_last_accessed xen +xenapi_torrent_max_seeder_processes_per_host xen +xenapi_torrent_seed_chance xen +xenapi_torrent_seed_duration xen +xenapi_use_agent_default xen +xenapi_vhd_coalesce_max_attempts xen +xenapi_vhd_coalesce_poll_interval xen +xenapi_vif_driver xen +xvpvncproxy_base_url xvpnvncproxy +xvpvncproxy_host xvpnvncproxy +xvpvncproxy_port xvpnvncproxy diff --git a/autogenerate-config-docs/flow.dia b/autogenerate-config-docs/flow.dia new file mode 100644 index 0000000000000000000000000000000000000000..637b485d264fff770fbbd9f094a18e5742ee70f0 GIT binary patch literal 3206 zcmV;140-b(iwFP!000021MOW)bK^D=zUx=8Jcr3vF)-ebC^M;KtETplt)#NMXBQ>G z5;HWZCF${a5BuAxT4FG=>{?A>MaIXhofbG}i}19dNxxt)|Y`P^SMhL16aRK2w2cC}Z_qDrAi zeY@N#(o>K7`(Bw+;$jE~lC%84R(9 znnez;{W7iV;*saSOtNa92DG=oY1~t_cV4Emhn07uL{BX@>8xH{eD%~_ZSA+7YX6c} z=_IpVPoL)X(W<{aPW9VwrIJW6oG6*r>6g2!dwo(&{c zWgUGV{Zf2ATN@%^hNQC(XTRai-r8;-)CLpbPIoPf^_UV!Y7uLs#C9+2&LMpwCX;Om zB{U+*=b2qgVU3hAWk`saa3l{DXfu0tF)hk`*H$=YyBaagl(O5lyXizBO}JTqlo}vw zVbl4d?iVJI7Wm$WvcrT`i{j>@!-#ww9iJj)napOJ$hg%Uj1GJ;wf(x&OWU)=R++w@ zXzas{a$Dx)-;*>S{azMM%X^H<2WH|vSTFLrOQ^daT_#s)b_>szv2{94?$2ybe}bK%*7<%k-u&=kLO183PMtMK7z&dEL0kecUnUat_n zexBB#&Rx(o`YXJEiH&SpFKijTpF+!O`#yq+@IA}|>E-Qv6yVK2yeUe+KjTQ7fNsx@ zZfrQZX~B(*iA3Bpyx}`JV}JyrDUT`k3vYv)wimvEVW-qReB%M%0>15wZ-3Zj0a{)! zM&JFmbWjIRpR6D*9!-)8Ag{=qr2+V7nN)BC1-H#Rt|`O~lPV?(i2!WJ0k(etAk30- z2DtWXn%fRI>w0 zi@|D65v7DXQcWv>;0yY-yQrliq9&EJ@slh>%` zal}_mkD})s(Q{& zPtP~#sM5~tC20E${##6KRozp2vQm3BRPCumQWF|;Bz)?;6T@0DW5y9S#>5)o14Ulh zI(dvVn5EO&C*w7|EUm8HvzMNy{zf$@}N56(YZDKAeJ14fJ+ zjoyS**Atf)^uRL6W3!7FQ%w&J@5IPxLt;w&+GH?!fW1`1YA_JEODWN6v%%Jx+vy&u)$0QBahlvUd z`rBgA@el@Gz0gV-!N<^ZCRme1&5dt8m#rkB3>!0-F(!56%P6d$LD4(g*#YYS=S0co z!7vVr9u$48==wC4%E;jSTCNax@%IEH<5B6kTl8tgXfYN7ai@Xo6;m+7J8n+~hAF=Z zPt4r^9J&}6SeL-MynWVXp4J!Bg`IxxBwk7viw})UXK8&Kco*-yiy(+;0=66toJ-(b zPKI+KgHy&`G?B*48meA;DB646c&!)oko8fjP)1T3-i?27faveVcC^O3p-W9HDD zwcv`Ksw<|3xMGC76zMWJd6p?8jaH6fa7(N{^&BKo)9jH)HKt>(kW)j{g2fyuMf4c#BtgOB0>MHan&tTvBB!H`-PRjX0*YdV4|R8gbN4n` z9R5-)&fqL_Cf(-Is*Mxj+^3dHM2yhj#A#u;8FT5<0NMx@#eK)f^|rG^)8WC0QO?`s zCPdBz7RS4yKb^%HoM!H}_EN;e^zfwb{q~jsIkb^8rV3FJGkWO0zNf(99HHCx+w@*K z2IpIvxuRY<9I_EbbEvHsIGn)YynPM_swtCcec{NOYLmvPY*J1aqY4Jh6vUR+Mwc*5 z9HUc>;QP6)n@sd7x-5&UK+bq4XDDEe1`E?55~!I#&75o|IvJdb4nB*L80-@6*PL^5 zNF!$~+|JU@5F)R6O>TI#^tD(wgnE=9(|s zH941x?ru3tF6=-4EV0o-W9~LO;bBoNSZ=4Zs5U$)-5{kXZBwwR*F7F7GJ=aHDP0;p z2FaR<)@H++_)b>sYiDO(E5WQ~)i5Q2at~{3Ys&ql($eYRv~)%hm8#infg9;_qjr!) zjBK`_PzIARH;6aP2lxWYdn!a=0OedC@*UGNd(h*KDSi}lJS3V19j;%gd-jzWC9O! zLOhH(&an+9CKPGm|JVk1pg9GnjFGXka3nX4RvjFq`^0k_I@;N3dbRc>2XE4ZlaIr8 z?)PYzm&!h;@(45x<}1GldscKM40n=<#>TNQgb>~mu-*yRzGik#37TphQ{@6=bkOs+ zrRNW+>M4i9sUz$pW4PiiAA*(N&1AG{c9{S@H)AdwouC@dg8JV|rn`|HVJ=YAZ58Tv zG{lSrJr8<*0^7+@eT3~~7^lS9shVTY+sRPv&O)NdFhF#-{kLL`>8_1`RqtzO&-UMp sxmkf6d_qZ3^*5^O!nypo<;PKb0e|LYa`kcaKPr7?=B~2<0K{H1?*IS* literal 0 HcmV?d00001 diff --git a/autogenerate-config-docs/test/README.md b/autogenerate-config-docs/test/README.md new file mode 100644 index 00000000..6c93df66 --- /dev/null +++ b/autogenerate-config-docs/test/README.md @@ -0,0 +1,3 @@ +These are to be placed in a directory *above* source repos. + +Edit the genconfs.sh line near the top that lists projects, for testing. diff --git a/autogenerate-config-docs/test/genconfs.sh b/autogenerate-config-docs/test/genconfs.sh new file mode 100755 index 00000000..14f798ea --- /dev/null +++ b/autogenerate-config-docs/test/genconfs.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +proj_list="ceilometer cinder glance keystone nova neutron" +#proj_list="keystone" + +for proj in ${proj_list}; do + + cd ${proj}; + +# -o ! -path "build/*" \ + FILES=$(find ${proj} -type f -name "*.py" ! -path "${proj}/tests/*" \ + ! -path "build/*" \ + -exec grep -l "Opt(" {} \; | sort -u) + + BINS=$(echo bin/${proj}-* | grep -v ${proj}-rootwrap) + export EVENTLET_NO_GREENDNS=yes + + PYTHONPATH=./:${PYTHONPATH} \ + python $(dirname "$0")/../generator.py ${FILES} ${BINS} > \ + ../${proj}.conf.sample + + # Remove compiled files created by imp.import_source() + for bin in ${BINS}; do + [ -f ${bin}c ] && rm ${bin}c + done + + cd - + +done + diff --git a/autogenerate-config-docs/test/generator.py b/autogenerate-config-docs/test/generator.py new file mode 100755 index 00000000..ca26ce9e --- /dev/null +++ b/autogenerate-config-docs/test/generator.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 SINA Corporation +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# 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. +# +# @author: Zhongyue Luo, SINA Corporation. +# +# ==================== +# Leaving original copyright/licensing info for now... though I made +# a couple small changes... +# --Steven Deaton (Jun. 11, 2013) +# ==================== + +"""Extracts OpenStack config option info from module(s).""" + +import imp +import os +import re +import socket +import sys +import textwrap + +from oslo.config import cfg + +from openstack.common import gettextutils +from openstack.common import importutils + +# sld +# ...not sure about these being needed, so they are commented for now. +#gettextutils.install('nova') +#gettextutils.install('ceilometer') + +STROPT = "StrOpt" +BOOLOPT = "BoolOpt" +INTOPT = "IntOpt" +FLOATOPT = "FloatOpt" +LISTOPT = "ListOpt" +MULTISTROPT = "MultiStrOpt" + +OPT_TYPES = { + STROPT: 'string value', + BOOLOPT: 'boolean value', + INTOPT: 'integer value', + FLOATOPT: 'floating point value', + LISTOPT: 'list value', + MULTISTROPT: 'multi valued', +} + +OPTION_COUNT = 0 +OPTION_REGEX = re.compile(r"(%s)" % "|".join([STROPT, BOOLOPT, INTOPT, + FLOATOPT, LISTOPT, + MULTISTROPT])) + +PY_EXT = ".py" +BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) +WORDWRAP_WIDTH = 60 + + +def generate(srcfiles): + mods_by_pkg = dict() + for filepath in srcfiles: + pkg_name = filepath.split(os.sep)[1] + mod_str = '.'.join(['.'.join(filepath.split(os.sep)[:-1]), + os.path.basename(filepath).split('.')[0]]) + mods_by_pkg.setdefault(pkg_name, list()).append(mod_str) + # NOTE(lzyeval): place top level modules before packages + pkg_names = filter(lambda x: x.endswith(PY_EXT), mods_by_pkg.keys()) + pkg_names.sort() + ext_names = filter(lambda x: x not in pkg_names, mods_by_pkg.keys()) + ext_names.sort() + pkg_names.extend(ext_names) + + # opts_by_group is a mapping of group name to an options list + # The options list is a list of (module, options) tuples + opts_by_group = {'DEFAULT': []} + + for pkg_name in pkg_names: + mods = mods_by_pkg.get(pkg_name) + mods.sort() + for mod_str in mods: + if mod_str.endswith('.__init__'): + mod_str = mod_str[:mod_str.rfind(".")] + + mod_obj = _import_module(mod_str) + if not mod_obj: + continue + + for group, opts in _list_opts(mod_obj): + opts_by_group.setdefault(group, []).append((mod_str, opts)) + + print_group_opts('DEFAULT', opts_by_group.pop('DEFAULT', [])) + for group, opts in opts_by_group.items(): + print_group_opts(group, opts) + + print "# Total option count: %d" % OPTION_COUNT + + +def _import_module(mod_str): + try: + if mod_str.startswith('bin.'): + imp.load_source(mod_str[4:], os.path.join('bin', mod_str[4:])) + return sys.modules[mod_str[4:]] + else: + return importutils.import_module(mod_str) + except ImportError as ie: + sys.stderr.write("%s\n" % str(ie)) + return None + except Exception: + return None + + +def _is_in_group(opt, group): + "Check if opt is in group." + for key, value in group._opts.items(): + if value['opt'] == opt: + return True + return False + + +def _guess_groups(opt, mod_obj): + # is it in the DEFAULT group? + if _is_in_group(opt, cfg.CONF): + return 'DEFAULT' + + # what other groups is it in? + for key, value in cfg.CONF.items(): + if isinstance(value, cfg.CONF.GroupAttr): + if _is_in_group(opt, value._group): + return value._group.name + + raise RuntimeError( + "Unable to find group for option %s, " + "maybe it's defined twice in the same group?" + % opt.name + ) + + +def _list_opts(obj): + def is_opt(o): + return (isinstance(o, cfg.Opt) and + not isinstance(o, cfg.SubCommandOpt)) + + opts = list() + for attr_str in dir(obj): + attr_obj = getattr(obj, attr_str) + if is_opt(attr_obj): + opts.append(attr_obj) + elif (isinstance(attr_obj, list) and + all(map(lambda x: is_opt(x), attr_obj))): + opts.extend(attr_obj) + + ret = {} + for opt in opts: + ret.setdefault(_guess_groups(opt, obj), []).append(opt) + return ret.items() + + +def print_group_opts(group, opts_by_module): + print "[%s]" % group + print + global OPTION_COUNT + for mod, opts in opts_by_module: + OPTION_COUNT += len(opts) + print '#' + print '# Options defined in %s' % mod + print '#' + print + for opt in opts: + _print_opt(opt) + print + + +def _get_my_ip(): + try: + csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + csock.connect(('8.8.8.8', 80)) + (addr, port) = csock.getsockname() + csock.close() + return addr + except socket.error: + return None + + +def _sanitize_default(s): + """Set up a reasonably sensible default for pybasedir, my_ip and host.""" + if s.startswith(BASEDIR): + return s.replace(BASEDIR, '/usr/lib/python/site-packages') + elif BASEDIR in s: + return s.replace(BASEDIR, '') + elif s == _get_my_ip(): + return '10.0.0.1' + elif s == socket.getfqdn(): + return 'localhost' + elif s.strip() != s: + return '"%s"' % s + return s + + +def _print_opt(opt): + opt_name, opt_default, opt_help = opt.dest, opt.default, opt.help + if not opt_help: + sys.stderr.write('WARNING: "%s" is missing help string.\n' % opt_name) + opt_type = None + try: + opt_type = OPTION_REGEX.search(str(type(opt))).group(0) + except (ValueError, AttributeError), err: + sys.stderr.write("%s\n" % str(err)) + sys.exit(1) + opt_help += ' (' + OPT_TYPES[opt_type] + ')' + print '#', "\n# ".join(textwrap.wrap(opt_help, WORDWRAP_WIDTH)) + try: + if opt_default is None: + print '#%s=' % opt_name + elif opt_type == STROPT: + assert(isinstance(opt_default, basestring)) + print '#%s=%s' % (opt_name, _sanitize_default(opt_default)) + elif opt_type == BOOLOPT: + assert(isinstance(opt_default, bool)) + print '#%s=%s' % (opt_name, str(opt_default).lower()) + elif opt_type == INTOPT: + assert(isinstance(opt_default, int) and + not isinstance(opt_default, bool)) + print '#%s=%s' % (opt_name, opt_default) + elif opt_type == FLOATOPT: + assert(isinstance(opt_default, float)) + print '#%s=%s' % (opt_name, opt_default) + elif opt_type == LISTOPT: + assert(isinstance(opt_default, list)) + print '#%s=%s' % (opt_name, ','.join(opt_default)) + elif opt_type == MULTISTROPT: + assert(isinstance(opt_default, list)) + if not opt_default: + opt_default = [''] + for default in opt_default: + print '#%s=%s' % (opt_name, default) + print + except Exception: + sys.stderr.write('Error in option "%s"\n' % opt_name) + sys.exit(1) + + +def main(): + if len(sys.argv) < 2: + print "usage: %s [srcfile]...\n" % sys.argv[0] + sys.exit(0) + generate(sys.argv[1:]) + +if __name__ == '__main__': + main()