commit 611b4c91ab6a5b06b5358b1f792e3b78268b9a53
Author: Emilien Macchi <email address hidden>
Date: Sun Oct 27 21:26:15 2019 +0100
Fix backward compatibility for old config startup files
In I1cf8923a698d0f6e0b1e00a7985f363a83e914c4, we changed the format for
container-startup-config and now have one JSON file per container, per
step. It'll make it easier to operate containers one by one, instead of
in one big JSON per step.
However this change wasn't 100% backward compatible, and this patch aims
to fix it.
This patch does:
1) Support a directory of configs without container name
The --file argument can now be a directory where the container
configuration file is located.
Reviewed: https:/ /review. opendev. org/701740 /git.openstack. org/cgit/ openstack/ paunch/ commit/ ?id=611b4c91ab6 a5b06b5358b1f79 2e3b78268b9a53
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 611b4c91ab6a5b0 6b5358b1f792e3b 78268b9a53
Author: Emilien Macchi <email address hidden>
Date: Sun Oct 27 21:26:15 2019 +0100
Fix backward compatibility for old config startup files
In I1cf8923a698d0f 6e0b1e00a7985f3 63a83e914c4, we changed the format for startup- config and now have one JSON file per container, per
container-
step. It'll make it easier to operate containers one by one, instead of
in one big JSON per step.
However this change wasn't 100% backward compatible, and this patch aims
to fix it.
This patch does:
1) Support a directory of configs without container name
The --file argument can now be a directory where the container
configuration file is located.
Example: tripleo- config/ container- startup- config/ step_1
paunch debug (...) --file /var/lib/
All configs will be returned.
2) Support a directory of config and a container name
Example: tripleo- config/ container- startup- config/ step_1
paunch debug (...) --container haproxy --file /var/lib/
Only the container config will be returned.
3) Support the old format file without container name
If the user specifies: tripleo- config/ hashed- container- startup- config- step_1. json
--file /var/lib/
It'll return all container configs for the JSON files in: lib/tripleo- config/ container- startup- config/ step_1/ (directory)
/var/
4) Support the old format file with container name
If the user specifies: tripleo- config/ hashed- container- startup- config- step_1. json
--container haproxy --file /var/lib/
It'll return the hashed container config file: lib/tripleo- config/ container- startup- config/ step_1/ hashed- haproxy. json
/var/
5) Add support for running paunch with a file + new format
The new format would be:
--container haproxy --file /var/lib/ tripleo- config/ container- startup- config/ step_1/ hashed- haproxy. json
The container config would be returned.
Note: if no name is specified, it'll try to guess the name based on the
file name. It'll remove "hashed-' from it in case it was an hashed file.
This patch should resolve all backward compatibility issues so Paunch
can be used with both the new and old format.
Closes-Bug: #1850050 614e73053654df6 ce181cf98fe 1fb1ac77e7eb199 036ff1c769)
Change-Id: I917679da22fa09
(cherry picked from commit 68ecaf90611718e