diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-06-08 06:12:22 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-06-08 23:17:18 +0200 |
commit | ff624f16bd7321760b98cb9a6c32ff29d1a11055 (patch) | |
tree | 74e1c1291b5472379dd6d7ae1f5aca5c8b7d8f2f /base/common/python | |
parent | a03dc2666a0f9e1441631bf95638c4225831baef (diff) | |
download | pki-ff624f16bd7321760b98cb9a6c32ff29d1a11055.tar.gz pki-ff624f16bd7321760b98cb9a6c32ff29d1a11055.tar.xz pki-ff624f16bd7321760b98cb9a6c32ff29d1a11055.zip |
Added TPS VLV management CLI.
A set of pki-server commands has been added to simplify upgrading
TPS VLV indexes.
https://fedorahosted.org/pki/ticket/2354
https://fedorahosted.org/pki/ticket/2263
https://fedorahosted.org/pki/ticket/2269
Diffstat (limited to 'base/common/python')
-rw-r--r-- | base/common/python/pki/util.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base/common/python/pki/util.py b/base/common/python/pki/util.py index 7220a7d49..2cac1d816 100644 --- a/base/common/python/pki/util.py +++ b/base/common/python/pki/util.py @@ -123,3 +123,15 @@ def chown(path, uid, gid): os.chown(itempath, uid, gid) elif os.path.isdir(itempath): chown(itempath, uid, gid) + + +def customize_file(input_file, output_file, params): + """ + Customize a file with specified parameters. + """ + + with open(input_file) as infile, open(output_file, 'w') as outfile: + for line in infile: + for src, target in params.items(): + line = line.replace(src, target) + outfile.write(line) |