From 47cf89cba09225874c31ec204303a0ac206417ff Mon Sep 17 00:00:00 2001 From: Roland Pinto Date: Wed, 16 Dec 2020 17:35:03 -0500 Subject: [PATCH] cli: fix user creation regression User creation throws an exception when redis acl option are not provided --- aiven/client/cli.py | 2 +- tests/test_cli.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/aiven/client/cli.py b/aiven/client/cli.py index 5ada0b7e..6eec4db6 100644 --- a/aiven/client/cli.py +++ b/aiven/client/cli.py @@ -1148,7 +1148,7 @@ def service__user_create(self): acl_params = { key: arg_vars[key].split() for key in {"redis_acl_keys", "redis_acl_commands", "redis_acl_categories"} - if key in arg_vars + if arg_vars[key] } if acl_params: extra_params = {"access_control": acl_params} diff --git a/tests/test_cli.py b/tests/test_cli.py index c5083357..ff171046 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -30,6 +30,10 @@ def test_service_types_v(): AivenCLI().run(args=["service", "types", "-v"]) +def test_service_user_create(): + AivenCLI().run(args=["service", "user-create", "service", "--username", "username"]) + + def test_help(): AivenCLI().run(args=["help"])