From 0dd2c10b87b17c4381719694a2cd2168e91b0e01 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sun, 3 Dec 2017 22:26:31 +0100 Subject: [PATCH] Add possibility to create arbitrary properties via portal-app-manager.py --- basic/portal-app-manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basic/portal-app-manager.py b/basic/portal-app-manager.py index 3e333f5..d25d991 100755 --- a/basic/portal-app-manager.py +++ b/basic/portal-app-manager.py @@ -17,6 +17,9 @@ def main(args): data[args.app]['login'] = args.login if args.password: data[args.app]['password'] = args.password + if args.property: + for key, value in args.property: + data[args.app][key] = value with open(jsonfile, 'w') as f: json.dump(data, f) @@ -26,4 +29,5 @@ if __name__ == '__main__': parser.add_argument('url', nargs='?', help='URL to the application. Use "{host}" as a host placeholder.') parser.add_argument('login', nargs='?', help='Administrative login.') parser.add_argument('password', nargs='?', help='Administrative password.') + parser.add_argument('-p', '--property', nargs=2, action='append', help='Add arbitrary key-value to the application properties') main(parser.parse_args())