aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkolla/cmd/mergepwd.py39
-rw-r--r--setup.cfg1
l---------tools/merge_passwords.py1
3 files changed, 41 insertions, 0 deletions
diff --git a/kolla/cmd/mergepwd.py b/kolla/cmd/mergepwd.py
new file mode 100755
index 000000000..b8fde1c77
--- /dev/null
+++ b/kolla/cmd/mergepwd.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import yaml
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--old", help="old password file", required=True)
+ parser.add_argument("--new", help="new password file", required=True)
+ parser.add_argument("--final", help="merged password file", required=True)
+ args = parser.parse_args()
+
+ with open(args.old, "r") as old_file:
+ old_passwords = yaml.safe_load(old_file)
+
+ with open(args.new, "r") as new_file:
+ new_passwords = yaml.safe_load(new_file)
+
+ new_passwords.update(old_passwords)
+
+ with open(args.final, "w") as destination:
+ yaml.dump(new_passwords, destination)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/setup.cfg b/setup.cfg
index bacc903c6..8f78de659 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -43,6 +43,7 @@ scripts =
console_scripts =
kolla-build = kolla.cmd.build:main
kolla-genpwd = kolla.cmd.genpwd:main
+ kolla-mergepwd = kolla.cmd.mergepwd:main
oslo.config.opts =
kolla = kolla.opts:list_opts
diff --git a/tools/merge_passwords.py b/tools/merge_passwords.py
new file mode 120000
index 000000000..ce2431d00
--- /dev/null
+++ b/tools/merge_passwords.py
@@ -0,0 +1 @@
+../kolla/cmd/mergepwd.py \ No newline at end of file