Skip to content
Snippets Groups Projects
Commit 82aa612e authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Add tool to merge passwords during release upgrade"

parents f7801165 14f9246f
No related branches found
No related tags found
No related merge requests found
#!/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()
...@@ -43,6 +43,7 @@ scripts = ...@@ -43,6 +43,7 @@ scripts =
console_scripts = console_scripts =
kolla-build = kolla.cmd.build:main kolla-build = kolla.cmd.build:main
kolla-genpwd = kolla.cmd.genpwd:main kolla-genpwd = kolla.cmd.genpwd:main
kolla-mergepwd = kolla.cmd.mergepwd:main
oslo.config.opts = oslo.config.opts =
kolla = kolla.opts:list_opts kolla = kolla.opts:list_opts
......
../kolla/cmd/mergepwd.py
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment