The correct export of the stack parameters no longer depends
on order of the tripleclient.constants.EXPORT_DATA,
as the lack of expected json file with parameters to export
raises exception, rather than filling the requested key with
data obtained in the previous iteration.
The I/O logic was moved to the tripleoclient.utils to keep
things more consistent.
No longer necessary json import was removed.
Tests were adjusted to mock more selectively.
Closes-Bug: #1940685
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ia7fb232261eb00c53d4e9bb352e572568704000f
New test case for handling a decoding error encountered
while reading a file.
Function documentation moved to docstring from comment,
and expanded to cover necessary API and implementation facts.
Too general 'Exception', raised if there are no data to export
for the specific key, was changed to 'RuntimeError'.
Some vars were renamed in order to improve readability.
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I04f8eb15e58a2bec125f5de23ec2da7e51454e1c
The 'tripleoclient.export.export_passwords' function was intended
export passwords selectively, if needed, based on provided rules.
This patch restores that functionality.
Furthermore, tests were adjusted to validate exports with and
without filtering.
Function level documentation was expanded with information about
inputs and outputs.
Per suggestion, the loop was adjusted to iterate over generated passwords
rather than over `tripleo_common_constants.PASSWORD_PARAMETER_NAMES`.
The existing import of tripleo_common.constants was removed, as there
were no more references to it.
Closes-Bug: #1933237
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I397caaf314dae17a48d4aeed55f1a5a8e4ae3d41
When 'openstack overcloud export ceph' is run, do not assume
the storage_ip will be set. Instead, find the ceph_mon_network
name in the service_net_map, e.g. 'storage' or 'ctlplane', and
then use that network name to get the IP from the inventory.
Closes-Bug: #1922788
Change-Id: I962bed846b2cae7206c76f883f9294d366031245
This changes to use the stack environment instead for
passwords when using ``overcloud export`` or
``overcloud cell export``.
Change-Id: Iae58a6415cc12e2035e0d3b62327e59e038d1b2c
Add a new command to export Ceph information from one or
more Heat stacks to be used as input of another stack.
Creates a valid YAML file with the CephExternalMultiConfig
parameter populated.
Also have export's export_password use yaml.safe_load in
place of the deprecated yaml.load.
Closes-Bug: #1895034
Change-Id: Ibdf9115e92c6b476b99d6df785b0c7e9f23991de
The overcloud export command needs to look at both the
parameter_defaults and passwords keys from plan-environment.yaml.
passwords contains only the generated password values, while
parameter_defaults contains any user set values. If a value is not set
in parameter_defaults, then passwords can be used.
Change-Id: I6b1b8bd1e7800720f6bbbe418c1f83b2f710fb48
Closes-Bug: #1891388
Signed-off-by: James Slagle <jslagle@redhat.com>
As part of mistral removal all config-downloaded playbooks
are run from tripleoclient. This changes the download location
to $HOME/config-download.
Documentation for default location will be changed along with
all doc changes for mistral removal.
Closes-Bug: #1874432
Depends-On: https://review.opendev.org/721568/
Change-Id: Ib4c9c47baabd64f008c4f61e4fa8c37a311350a3
Add a new command to export the data from a control plane stack for
multi-stack. The created export file can be used as input into a compute
stack for the multi-stack feature.
Also refactors the overcloud cell export command to use the same common
code.
Closes-Bug: #1850636
Change-Id: I6e145d7a54dcd306c4633ebd4d7471a19a967a86