Allow command-line options with --gen-answer-file

Previously, packstack --gen-answer-file did not allow settting any
other command-line option other than the default password. This is
not required, with this patch the answer file would contain any
command-line specified option as well.

Change-Id: Ic5180fa37bb0dc1371f58132f9c70dd655c0fc8c
This commit is contained in:
Javier Pena
2015-02-20 11:17:07 +01:00
parent 92e69bd080
commit 184dad441c
2 changed files with 3 additions and 5 deletions

View File

@@ -14,9 +14,9 @@ Packstack is a utility that uses uses puppet modules to install OpenStack. It ca
- packstack
- packstack [options]
- packstack --gen-answer-file=<file> [--default-password=<passwd>] / packstack --answer-file=<file>
- packstack --gen-answer-file=<file> [options] / packstack --answer-file=<file>
The third option allows the user to generate a default answer file, edit the default options and finally run Packstack a second time using this answer file. This is the easiest way to run Packstack and the one that will be documented here. Optionally, it is possible to specify a default password when generating the answer file, and this default password will be used for all accounts.
The third option allows the user to generate a default answer file, edit the default options and finally run Packstack a second time using this answer file. This is the easiest way to run Packstack and the one that will be documented here. Optionally, it is possible to set additional command-line options (such as a default password), and those options will be set in the answer file.
When <file> is created, it will contain the OPTIONS below, which can then be edited by the user.

View File

@@ -801,7 +801,7 @@ def initCmdLineParser():
# Init parser and all general flags
usage = "usage: %prog [options] [--help]"
parser = OptionParser(usage=usage, version="%prog {0} {1}".format(version.release_string(), version.version_string()))
parser.add_option("--gen-answer-file", help="Generate a template of an answer file, using this option excludes all other options")
parser.add_option("--gen-answer-file", help="Generate a template of an answer file.")
parser.add_option("--answer-file", help="Runs the configuration in non-interactive mode, extracting all information from the"
"configuration file. using this option excludes all other options")
parser.add_option("--install-hosts", help="Install on a set of hosts in a single step. The format should be a comma separated list "
@@ -972,8 +972,6 @@ def main():
# If --gen-answer-file was supplied, do not run main
if options.gen_answer_file:
# Make sure only --gen-answer-file was supplied
validateSingleFlag(options, "gen_answer_file")
answerfilepath = _gettmpanswerfilepath()
if not answerfilepath:
_printAdditionalMessages()