Use YAML inventory for minor update

This makes sure we can correctly handle multiline strings. The
previous ini format was quite limited in what it could handle, and
multiline strings broke it.

Change-Id: I9ee83f81eaf49b16fb4002bf8d7a3ecb4fe1553d
Closes-Bug: #1744003
This commit is contained in:
Jiri Stransky 2018-01-23 14:53:33 +01:00
parent 11b659aea0
commit 4ed12dac80
1 changed files with 7 additions and 5 deletions

View File

@ -85,8 +85,9 @@ class UpdateOvercloud(command.Command):
action="store",
default=None,
help=_('Path to an existing ansible inventory to '
'use. If not specified, one will be '
'generated in ~/tripleo-ansible-inventory')
'use. If not specified, one will be '
'generated in '
'~/tripleo-ansible-inventory.yaml')
)
return parser
@ -131,10 +132,11 @@ class UpdateOvercloud(command.Command):
inventory_file = parsed_args.static_inventory
if inventory_file is None:
inventory_file = '%s/%s' % (os.path.expanduser('~'),
'tripleo-ansible-inventory')
'tripleo-ansible-inventory.yaml')
try:
processutils.execute('/bin/tripleo-ansible-inventory',
'--static-inventory', inventory_file)
processutils.execute(
'/usr/bin/tripleo-ansible-inventory',
'--static-yaml-inventory', inventory_file)
except processutils.ProcessExecutionError as e:
message = "Failed to generate inventory: %s" % str(e)
raise exceptions.InvalidConfiguration(message)