Merge "Allow --default-password with --gen-answer-file"
This commit is contained in:
@@ -14,9 +14,11 @@ Packstack is a utility that uses uses puppet modules to install OpenStack. It ca
|
|||||||
|
|
||||||
- packstack
|
- packstack
|
||||||
- packstack [options]
|
- packstack [options]
|
||||||
- packstack --gen-answer-file=<file> / packstack --answer-file=<file>
|
- packstack --gen-answer-file=<file> [--default-password=<passwd>] / 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. When <file> is created, it will contain the OPTIONS below, which can then be edited by the user.
|
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.
|
||||||
|
|
||||||
|
When <file> is created, it will contain the OPTIONS below, which can then be edited by the user.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
|
|||||||
@@ -857,7 +857,7 @@ def countCmdLineFlags(options, flag):
|
|||||||
counter = 0
|
counter = 0
|
||||||
# make sure only flag was supplied
|
# make sure only flag was supplied
|
||||||
for key, value in options.__dict__.items():
|
for key, value in options.__dict__.items():
|
||||||
if key in (flag, 'debug', 'timeout', 'dry_run'):
|
if key in (flag, 'debug', 'timeout', 'dry_run', 'default_password'):
|
||||||
next
|
next
|
||||||
# If anything but flag was called, increment
|
# If anything but flag was called, increment
|
||||||
elif value:
|
elif value:
|
||||||
@@ -924,7 +924,12 @@ def main():
|
|||||||
if not answerfilepath:
|
if not answerfilepath:
|
||||||
_printAdditionalMessages()
|
_printAdditionalMessages()
|
||||||
return
|
return
|
||||||
generateAnswerFile(answerfilepath)
|
# We can also override defaults with command line options
|
||||||
|
overrides = {}
|
||||||
|
_set_command_line_values(options)
|
||||||
|
for key,value in commandLineValues.items():
|
||||||
|
overrides[key] = value
|
||||||
|
generateAnswerFile(answerfilepath,overrides)
|
||||||
_handleParams(answerfilepath)
|
_handleParams(answerfilepath)
|
||||||
generateAnswerFile(options.gen_answer_file)
|
generateAnswerFile(options.gen_answer_file)
|
||||||
# Are we installing an all in one
|
# Are we installing an all in one
|
||||||
@@ -942,6 +947,12 @@ def main():
|
|||||||
# Make sure only --answer-file was supplied
|
# Make sure only --answer-file was supplied
|
||||||
if options.answer_file:
|
if options.answer_file:
|
||||||
validateSingleFlag(options, "answer_file")
|
validateSingleFlag(options, "answer_file")
|
||||||
|
# If using an answer file, setting a default password
|
||||||
|
# does not really make sense
|
||||||
|
if getattr(options,'default_password',None):
|
||||||
|
msg = ('Please do not set --default-password '
|
||||||
|
'when specifying an answer file.')
|
||||||
|
raise FlagValidationError(msg)
|
||||||
confFile = os.path.expanduser(options.answer_file)
|
confFile = os.path.expanduser(options.answer_file)
|
||||||
if not os.path.exists(confFile):
|
if not os.path.exists(confFile):
|
||||||
raise Exception(output_messages.ERR_NO_ANSWER_FILE % confFile)
|
raise Exception(output_messages.ERR_NO_ANSWER_FILE % confFile)
|
||||||
|
|||||||
Reference in New Issue
Block a user