diff --git a/doc/source/_templates/sidebarlinks.html b/doc/source/_templates/sidebarlinks.html
index f947439..ccfb54a 100644
--- a/doc/source/_templates/sidebarlinks.html
+++ b/doc/source/_templates/sidebarlinks.html
@@ -1,5 +1,4 @@
Useful Links
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 9de9966..154059a 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -199,7 +199,7 @@ latex_elements = {
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'stackalyticsdoc.tex', u'Stackalytics',
+ ('index', 'shakerdoc.tex', u'Shaker',
u'Mirantis Inc.', 'manual'),
]
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 5632421..9981f70 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1,4 +1,6 @@
Welcome to Shaker!
==================
-Shake VMs with our sheer-class tests!
\ No newline at end of file
+Shake VMs with our sheer-class tests!
+
+.. include:: tools.rst
diff --git a/doc/source/tools.rst b/doc/source/tools.rst
new file mode 100644
index 0000000..85d24d8
--- /dev/null
+++ b/doc/source/tools.rst
@@ -0,0 +1,28 @@
+shaker
+------
+
+The tool runs specified scenario
+
+.. literalinclude:: tools/shaker.txt
+
+shaker-agent
+------------
+
+.. literalinclude:: tools/shaker-agent.txt
+
+shaker-report
+-------------
+
+.. literalinclude:: tools/shaker-report.txt
+
+shaker-image-builder
+--------------------
+
+The tool that creates master image in OpenStack cloud.
+
+.. literalinclude:: tools/shaker-image-builder.txt
+
+shaker-cleanup
+--------------
+
+.. literalinclude:: tools/shaker-cleanup.txt
diff --git a/doc/source/tools/shaker-agent.txt b/doc/source/tools/shaker-agent.txt
new file mode 100644
index 0000000..3b3edf4
--- /dev/null
+++ b/doc/source/tools/shaker-agent.txt
@@ -0,0 +1,67 @@
+usage: shaker-agent [-h] [--agent-id AGENT_ID] [--config-dir DIR]
+ [--config-file PATH] [--debug] [--log-config-append PATH]
+ [--log-date-format DATE_FORMAT] [--log-dir LOG_DIR]
+ [--log-file PATH] [--log-format FORMAT] [--nodebug]
+ [--nouse-syslog] [--nouse-syslog-rfc-format] [--noverbose]
+ [--polling-interval POLLING_INTERVAL]
+ [--syslog-log-facility SYSLOG_LOG_FACILITY] [--use-syslog]
+ [--use-syslog-rfc-format] [--verbose] [--version]
+ [--server-endpoint SERVER_ENDPOINT]
+
+optional arguments:
+ -h, --help show this help message and exit
+ --agent-id AGENT_ID Agent unique id, defaults to env[SHAKER_AGENT_ID].
+ --config-dir DIR Path to a config directory to pull *.conf files from.
+ This file set is sorted, so as to provide a
+ predictable parse order if individual options are
+ over-ridden. The set is parsed after the file(s)
+ specified via previous --config-file, arguments hence
+ over-ridden options in the directory take precedence.
+ --config-file PATH Path to a config file to use. Multiple config files
+ can be specified, with values in later files taking
+ precedence. The default files used are: None.
+ --debug, -d Print debugging output (set logging level to DEBUG
+ instead of default WARNING level).
+ --log-config-append PATH, --log_config PATH
+ The name of a logging configuration file. This file is
+ appended to any existing logging configuration files.
+ For details about logging configuration files, see the
+ Python logging module documentation.
+ --log-date-format DATE_FORMAT
+ Format string for %(asctime)s in log records. Default:
+ None .
+ --log-dir LOG_DIR, --logdir LOG_DIR
+ (Optional) The base directory used for relative --log-
+ file paths.
+ --log-file PATH, --logfile PATH
+ (Optional) Name of log file to output to. If no
+ default is set, logging will go to stdout.
+ --log-format FORMAT DEPRECATED. A logging.Formatter log message format
+ string which may use any of the available
+ logging.LogRecord attributes. This option is
+ deprecated. Please use logging_context_format_string
+ and logging_default_format_string instead.
+ --nodebug The inverse of --debug
+ --nouse-syslog The inverse of --use-syslog
+ --nouse-syslog-rfc-format
+ The inverse of --use-syslog-rfc-format
+ --noverbose The inverse of --verbose
+ --polling-interval POLLING_INTERVAL
+ How frequently the agent polls server, in seconds
+ --syslog-log-facility SYSLOG_LOG_FACILITY
+ Syslog facility to receive log lines.
+ --use-syslog Use syslog for logging. Existing syslog format is
+ DEPRECATED during I, and will change in J to honor
+ RFC5424.
+ --use-syslog-rfc-format
+ (Optional) Enables or disables syslog rfc5424 format
+ for logging. If enabled, prefixes the MSG part of the
+ syslog message with APP-NAME (RFC5424). The format
+ without the APP-NAME is deprecated in I, and will be
+ removed in J.
+ --verbose, -v Print more verbose output (set logging level to INFO
+ instead of default WARNING level).
+ --version show program's version number and exit
+ --server-endpoint SERVER_ENDPOINT
+ Address for server connections (host:port), defaults
+ to env[SHAKER_SERVER_ENDPOINT].
diff --git a/doc/source/tools/shaker-cleanup.txt b/doc/source/tools/shaker-cleanup.txt
new file mode 100644
index 0000000..82a4b73
--- /dev/null
+++ b/doc/source/tools/shaker-cleanup.txt
@@ -0,0 +1,91 @@
+usage: shaker-cleanup [-h] [--config-dir DIR] [--config-file PATH] [--debug]
+ [--external-net EXTERNAL_NET]
+ [--flavor-name FLAVOR_NAME]
+ [--image-builder-template IMAGE_BUILDER_TEMPLATE]
+ [--image-name IMAGE_NAME] [--log-config-append PATH]
+ [--log-date-format DATE_FORMAT] [--log-dir LOG_DIR]
+ [--log-file PATH] [--log-format FORMAT] [--nodebug]
+ [--nouse-syslog] [--nouse-syslog-rfc-format]
+ [--noverbose] [--os-password ]
+ [--os-region-name ]
+ [--os-tenant-name ]
+ [--os-username ]
+ [--syslog-log-facility SYSLOG_LOG_FACILITY]
+ [--use-syslog] [--use-syslog-rfc-format] [--verbose]
+ [--version] [--os-auth-url ]
+
+optional arguments:
+ -h, --help show this help message and exit
+ --config-dir DIR Path to a config directory to pull *.conf files from.
+ This file set is sorted, so as to provide a
+ predictable parse order if individual options are
+ over-ridden. The set is parsed after the file(s)
+ specified via previous --config-file, arguments hence
+ over-ridden options in the directory take precedence.
+ --config-file PATH Path to a config file to use. Multiple config files
+ can be specified, with values in later files taking
+ precedence. The default files used are: None.
+ --debug, -d Print debugging output (set logging level to DEBUG
+ instead of default WARNING level).
+ --external-net EXTERNAL_NET
+ Name or ID of external network, defaults to
+ env[SHAKER_EXTERNAL_NET]. If no value provided then
+ Shaker picks any of available external networks.
+ --flavor-name FLAVOR_NAME
+ Name of image flavor. The default is created by
+ shaker-image-builder.
+ --image-builder-template IMAGE_BUILDER_TEMPLATE
+ Heat template for the image builder.
+ --image-name IMAGE_NAME
+ Name of image to use. The default is created by
+ shaker-image-builder.
+ --log-config-append PATH, --log_config PATH
+ The name of a logging configuration file. This file is
+ appended to any existing logging configuration files.
+ For details about logging configuration files, see the
+ Python logging module documentation.
+ --log-date-format DATE_FORMAT
+ Format string for %(asctime)s in log records. Default:
+ None .
+ --log-dir LOG_DIR, --logdir LOG_DIR
+ (Optional) The base directory used for relative --log-
+ file paths.
+ --log-file PATH, --logfile PATH
+ (Optional) Name of log file to output to. If no
+ default is set, logging will go to stdout.
+ --log-format FORMAT DEPRECATED. A logging.Formatter log message format
+ string which may use any of the available
+ logging.LogRecord attributes. This option is
+ deprecated. Please use logging_context_format_string
+ and logging_default_format_string instead.
+ --nodebug The inverse of --debug
+ --nouse-syslog The inverse of --use-syslog
+ --nouse-syslog-rfc-format
+ The inverse of --use-syslog-rfc-format
+ --noverbose The inverse of --verbose
+ --os-password
+ Authentication password, defaults to env[OS_PASSWORD].
+ --os-region-name
+ Authentication region name, defaults to
+ env[OS_REGION_NAME].
+ --os-tenant-name
+ Authentication tenant name, defaults to
+ env[OS_TENANT_NAME].
+ --os-username
+ Authentication username, defaults to env[OS_USERNAME].
+ --syslog-log-facility SYSLOG_LOG_FACILITY
+ Syslog facility to receive log lines.
+ --use-syslog Use syslog for logging. Existing syslog format is
+ DEPRECATED during I, and will change in J to honor
+ RFC5424.
+ --use-syslog-rfc-format
+ (Optional) Enables or disables syslog rfc5424 format
+ for logging. If enabled, prefixes the MSG part of the
+ syslog message with APP-NAME (RFC5424). The format
+ without the APP-NAME is deprecated in I, and will be
+ removed in J.
+ --verbose, -v Print more verbose output (set logging level to INFO
+ instead of default WARNING level).
+ --version show program's version number and exit
+ --os-auth-url
+ Authentication URL, defaults to env[OS_AUTH_URL].
diff --git a/doc/source/tools/shaker-image-builder.txt b/doc/source/tools/shaker-image-builder.txt
new file mode 100644
index 0000000..c523b1b
--- /dev/null
+++ b/doc/source/tools/shaker-image-builder.txt
@@ -0,0 +1,93 @@
+usage: shaker-image-builder [-h] [--config-dir DIR] [--config-file PATH]
+ [--debug] [--external-net EXTERNAL_NET]
+ [--flavor-name FLAVOR_NAME]
+ [--image-builder-template IMAGE_BUILDER_TEMPLATE]
+ [--image-name IMAGE_NAME]
+ [--log-config-append PATH]
+ [--log-date-format DATE_FORMAT]
+ [--log-dir LOG_DIR] [--log-file PATH]
+ [--log-format FORMAT] [--nodebug] [--nouse-syslog]
+ [--nouse-syslog-rfc-format] [--noverbose]
+ [--os-password ]
+ [--os-region-name ]
+ [--os-tenant-name ]
+ [--os-username ]
+ [--syslog-log-facility SYSLOG_LOG_FACILITY]
+ [--use-syslog] [--use-syslog-rfc-format]
+ [--verbose] [--version] [--os-auth-url ]
+
+optional arguments:
+ -h, --help show this help message and exit
+ --config-dir DIR Path to a config directory to pull *.conf files from.
+ This file set is sorted, so as to provide a
+ predictable parse order if individual options are
+ over-ridden. The set is parsed after the file(s)
+ specified via previous --config-file, arguments hence
+ over-ridden options in the directory take precedence.
+ --config-file PATH Path to a config file to use. Multiple config files
+ can be specified, with values in later files taking
+ precedence. The default files used are: None.
+ --debug, -d Print debugging output (set logging level to DEBUG
+ instead of default WARNING level).
+ --external-net EXTERNAL_NET
+ Name or ID of external network, defaults to
+ env[SHAKER_EXTERNAL_NET]. If no value provided then
+ Shaker picks any of available external networks.
+ --flavor-name FLAVOR_NAME
+ Name of image flavor. The default is created by
+ shaker-image-builder.
+ --image-builder-template IMAGE_BUILDER_TEMPLATE
+ Heat template for the image builder.
+ --image-name IMAGE_NAME
+ Name of image to use. The default is created by
+ shaker-image-builder.
+ --log-config-append PATH, --log_config PATH
+ The name of a logging configuration file. This file is
+ appended to any existing logging configuration files.
+ For details about logging configuration files, see the
+ Python logging module documentation.
+ --log-date-format DATE_FORMAT
+ Format string for %(asctime)s in log records. Default:
+ None .
+ --log-dir LOG_DIR, --logdir LOG_DIR
+ (Optional) The base directory used for relative --log-
+ file paths.
+ --log-file PATH, --logfile PATH
+ (Optional) Name of log file to output to. If no
+ default is set, logging will go to stdout.
+ --log-format FORMAT DEPRECATED. A logging.Formatter log message format
+ string which may use any of the available
+ logging.LogRecord attributes. This option is
+ deprecated. Please use logging_context_format_string
+ and logging_default_format_string instead.
+ --nodebug The inverse of --debug
+ --nouse-syslog The inverse of --use-syslog
+ --nouse-syslog-rfc-format
+ The inverse of --use-syslog-rfc-format
+ --noverbose The inverse of --verbose
+ --os-password
+ Authentication password, defaults to env[OS_PASSWORD].
+ --os-region-name
+ Authentication region name, defaults to
+ env[OS_REGION_NAME].
+ --os-tenant-name
+ Authentication tenant name, defaults to
+ env[OS_TENANT_NAME].
+ --os-username
+ Authentication username, defaults to env[OS_USERNAME].
+ --syslog-log-facility SYSLOG_LOG_FACILITY
+ Syslog facility to receive log lines.
+ --use-syslog Use syslog for logging. Existing syslog format is
+ DEPRECATED during I, and will change in J to honor
+ RFC5424.
+ --use-syslog-rfc-format
+ (Optional) Enables or disables syslog rfc5424 format
+ for logging. If enabled, prefixes the MSG part of the
+ syslog message with APP-NAME (RFC5424). The format
+ without the APP-NAME is deprecated in I, and will be
+ removed in J.
+ --verbose, -v Print more verbose output (set logging level to INFO
+ instead of default WARNING level).
+ --version show program's version number and exit
+ --os-auth-url
+ Authentication URL, defaults to env[OS_AUTH_URL].
diff --git a/doc/source/tools/shaker-report.txt b/doc/source/tools/shaker-report.txt
new file mode 100644
index 0000000..2ffbed4
--- /dev/null
+++ b/doc/source/tools/shaker-report.txt
@@ -0,0 +1,67 @@
+usage: shaker-report [-h] [--config-dir DIR] [--config-file PATH] [--debug]
+ [--input INPUT] [--log-config-append PATH]
+ [--log-date-format DATE_FORMAT] [--log-dir LOG_DIR]
+ [--log-file PATH] [--log-format FORMAT] [--nodebug]
+ [--nouse-syslog] [--nouse-syslog-rfc-format]
+ [--noverbose] [--report REPORT]
+ [--syslog-log-facility SYSLOG_LOG_FACILITY]
+ [--use-syslog] [--use-syslog-rfc-format] [--verbose]
+ [--version] [--report-template REPORT_TEMPLATE]
+
+optional arguments:
+ -h, --help show this help message and exit
+ --config-dir DIR Path to a config directory to pull *.conf files from.
+ This file set is sorted, so as to provide a
+ predictable parse order if individual options are
+ over-ridden. The set is parsed after the file(s)
+ specified via previous --config-file, arguments hence
+ over-ridden options in the directory take precedence.
+ --config-file PATH Path to a config file to use. Multiple config files
+ can be specified, with values in later files taking
+ precedence. The default files used are: None.
+ --debug, -d Print debugging output (set logging level to DEBUG
+ instead of default WARNING level).
+ --input INPUT File to read test results from, defaults to
+ env[SHAKER_INPUT].
+ --log-config-append PATH, --log_config PATH
+ The name of a logging configuration file. This file is
+ appended to any existing logging configuration files.
+ For details about logging configuration files, see the
+ Python logging module documentation.
+ --log-date-format DATE_FORMAT
+ Format string for %(asctime)s in log records. Default:
+ None .
+ --log-dir LOG_DIR, --logdir LOG_DIR
+ (Optional) The base directory used for relative --log-
+ file paths.
+ --log-file PATH, --logfile PATH
+ (Optional) Name of log file to output to. If no
+ default is set, logging will go to stdout.
+ --log-format FORMAT DEPRECATED. A logging.Formatter log message format
+ string which may use any of the available
+ logging.LogRecord attributes. This option is
+ deprecated. Please use logging_context_format_string
+ and logging_default_format_string instead.
+ --nodebug The inverse of --debug
+ --nouse-syslog The inverse of --use-syslog
+ --nouse-syslog-rfc-format
+ The inverse of --use-syslog-rfc-format
+ --noverbose The inverse of --verbose
+ --report REPORT Report file name, defaults to env[SHAKER_REPORT]. If
+ no value provided the report is printed to stdout.
+ --syslog-log-facility SYSLOG_LOG_FACILITY
+ Syslog facility to receive log lines.
+ --use-syslog Use syslog for logging. Existing syslog format is
+ DEPRECATED during I, and will change in J to honor
+ RFC5424.
+ --use-syslog-rfc-format
+ (Optional) Enables or disables syslog rfc5424 format
+ for logging. If enabled, prefixes the MSG part of the
+ syslog message with APP-NAME (RFC5424). The format
+ without the APP-NAME is deprecated in I, and will be
+ removed in J.
+ --verbose, -v Print more verbose output (set logging level to INFO
+ instead of default WARNING level).
+ --version show program's version number and exit
+ --report-template REPORT_TEMPLATE
+ Report template in Jinja format
diff --git a/doc/source/tools/shaker.txt b/doc/source/tools/shaker.txt
new file mode 100644
index 0000000..7acaeb9
--- /dev/null
+++ b/doc/source/tools/shaker.txt
@@ -0,0 +1,101 @@
+usage: shaker [-h] [--config-dir DIR] [--config-file PATH] [--debug]
+ [--external-net EXTERNAL_NET] [--flavor-name FLAVOR_NAME]
+ [--image-name IMAGE_NAME] [--log-config-append PATH]
+ [--log-date-format DATE_FORMAT] [--log-dir LOG_DIR]
+ [--log-file PATH] [--log-format FORMAT] [--nodebug]
+ [--nouse-syslog] [--nouse-syslog-rfc-format] [--noverbose]
+ [--os-auth-url ] [--os-password ]
+ [--os-region-name ]
+ [--os-tenant-name ]
+ [--os-username ] [--output OUTPUT]
+ [--polling-interval POLLING_INTERVAL] [--report REPORT]
+ [--report-template REPORT_TEMPLATE] [--scenario SCENARIO]
+ [--syslog-log-facility SYSLOG_LOG_FACILITY] [--use-syslog]
+ [--use-syslog-rfc-format] [--verbose] [--version]
+ [--server-endpoint SERVER_ENDPOINT]
+
+optional arguments:
+ -h, --help show this help message and exit
+ --config-dir DIR Path to a config directory to pull *.conf files from.
+ This file set is sorted, so as to provide a
+ predictable parse order if individual options are
+ over-ridden. The set is parsed after the file(s)
+ specified via previous --config-file, arguments hence
+ over-ridden options in the directory take precedence.
+ --config-file PATH Path to a config file to use. Multiple config files
+ can be specified, with values in later files taking
+ precedence. The default files used are: None.
+ --debug, -d Print debugging output (set logging level to DEBUG
+ instead of default WARNING level).
+ --external-net EXTERNAL_NET
+ Name or ID of external network, defaults to
+ env[SHAKER_EXTERNAL_NET]. If no value provided then
+ Shaker picks any of available external networks.
+ --flavor-name FLAVOR_NAME
+ Name of image flavor. The default is created by
+ shaker-image-builder.
+ --image-name IMAGE_NAME
+ Name of image to use. The default is created by
+ shaker-image-builder.
+ --log-config-append PATH, --log_config PATH
+ The name of a logging configuration file. This file is
+ appended to any existing logging configuration files.
+ For details about logging configuration files, see the
+ Python logging module documentation.
+ --log-date-format DATE_FORMAT
+ Format string for %(asctime)s in log records. Default:
+ None .
+ --log-dir LOG_DIR, --logdir LOG_DIR
+ (Optional) The base directory used for relative --log-
+ file paths.
+ --log-file PATH, --logfile PATH
+ (Optional) Name of log file to output to. If no
+ default is set, logging will go to stdout.
+ --log-format FORMAT DEPRECATED. A logging.Formatter log message format
+ string which may use any of the available
+ logging.LogRecord attributes. This option is
+ deprecated. Please use logging_context_format_string
+ and logging_default_format_string instead.
+ --nodebug The inverse of --debug
+ --nouse-syslog The inverse of --use-syslog
+ --nouse-syslog-rfc-format
+ The inverse of --use-syslog-rfc-format
+ --noverbose The inverse of --verbose
+ --os-auth-url
+ Authentication URL, defaults to env[OS_AUTH_URL].
+ --os-password
+ Authentication password, defaults to env[OS_PASSWORD].
+ --os-region-name
+ Authentication region name, defaults to
+ env[OS_REGION_NAME].
+ --os-tenant-name
+ Authentication tenant name, defaults to
+ env[OS_TENANT_NAME].
+ --os-username
+ Authentication username, defaults to env[OS_USERNAME].
+ --output OUTPUT File for output in JSON format, defaults to
+ env[SHAKER_OUTPUT].
+ --polling-interval POLLING_INTERVAL
+ How frequently the agent polls server, in seconds
+ --report REPORT Report file name, defaults to env[SHAKER_REPORT]. If
+ no value provided the report is printed to stdout.
+ --report-template REPORT_TEMPLATE
+ Report template in Jinja format
+ --scenario SCENARIO Scenario file name, defaults to env[SHAKER_SCENARIO].
+ --syslog-log-facility SYSLOG_LOG_FACILITY
+ Syslog facility to receive log lines.
+ --use-syslog Use syslog for logging. Existing syslog format is
+ DEPRECATED during I, and will change in J to honor
+ RFC5424.
+ --use-syslog-rfc-format
+ (Optional) Enables or disables syslog rfc5424 format
+ for logging. If enabled, prefixes the MSG part of the
+ syslog message with APP-NAME (RFC5424). The format
+ without the APP-NAME is deprecated in I, and will be
+ removed in J.
+ --verbose, -v Print more verbose output (set logging level to INFO
+ instead of default WARNING level).
+ --version show program's version number and exit
+ --server-endpoint SERVER_ENDPOINT
+ Address for server connections (host:port), defaults
+ to env[SHAKER_SERVER_ENDPOINT].
diff --git a/etc/shaker.conf b/etc/shaker.conf
index 7033648..d8b1916 100644
--- a/etc/shaker.conf
+++ b/etc/shaker.conf
@@ -67,7 +67,7 @@
#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s
# List of logger=LEVEL pairs. (list value)
-#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN
+#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN
# Enables or disables publication of error events. (boolean value)
#publish_errors = false
diff --git a/tools/cli_auto_doc.py b/tools/cli_auto_doc.py
new file mode 100644
index 0000000..3fa4e46
--- /dev/null
+++ b/tools/cli_auto_doc.py
@@ -0,0 +1,62 @@
+# Copyright (c) 2015 Mirantis Inc.
+#
+# 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.
+
+import os
+import sys
+
+try:
+ import ConfigParser as configparser
+except ImportError:
+ import configparser
+
+
+def split_multiline(value):
+ value = [element for element in
+ (line.strip() for line in value.split('\n'))
+ if element]
+ return value
+
+
+def get_entry_points(config):
+ if 'entry_points' not in config:
+ return {}
+ return dict((option, split_multiline(value))
+ for option, value in config['entry_points'].items())
+
+
+def make(cfg, dest):
+ parser = configparser.RawConfigParser()
+ parser.read(cfg)
+ config = {}
+ for section in parser.sections():
+ config[section] = dict(parser.items(section))
+ entry_points = get_entry_points(config)
+
+ console_scripts = entry_points.get('console_scripts')
+ if console_scripts:
+ for item in console_scripts:
+ tool = item.split('=')[0].strip()
+ print('Running %s' % tool)
+ os.system('%(tool)s --help > %(dest)s/%(tool)s.txt' %
+ dict(tool=tool, dest=dest))
+
+
+if len(sys.argv) < 2:
+ print('Usage: cli_auto_doc ')
+ sys.exit(1)
+
+
+print('Generating docs from help to console tools')
+make(cfg='setup.cfg', dest=sys.argv[1])
diff --git a/tox.ini b/tox.ini
index 1bd7fdc..aafe9ee 100644
--- a/tox.ini
+++ b/tox.ini
@@ -33,6 +33,7 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:genconfig]
commands =
oslo-config-generator --config-file=config-generator.conf
+ python tools/cli_auto_doc.py doc/source/tools
[tox:jenkins]
downloadcache = ~/cache/pip