From 149beedf207246d4476e8cdf0b7d7cbda2890a6f Mon Sep 17 00:00:00 2001 From: vavuthu Date: Wed, 9 Mar 2022 17:34:56 +0530 Subject: [PATCH] core: assign ACCESS_KEY and SECRET_KEY values only in case of actual run When using dry-run option with external script, function create_rgw_admin_ops_user is not returning expected values which leads to TypeError. This fix is to append values to out_map dictionary only in case of actual run. Signed-off-by: vavuthu --- deploy/examples/create-external-cluster-resources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/examples/create-external-cluster-resources.py b/deploy/examples/create-external-cluster-resources.py index a8f205336..a6df3f789 100644 --- a/deploy/examples/create-external-cluster-resources.py +++ b/deploy/examples/create-external-cluster-resources.py @@ -871,7 +871,10 @@ class RadosJSON: self.out_map['RBD_METADATA_EC_POOL_NAME'] = self.validate_rgw_metadata_ec_pool_name() self.out_map['RGW_POOL_PREFIX'] = self._arg_parser.rgw_pool_prefix if self._arg_parser.rgw_endpoint: - self.out_map['ACCESS_KEY'], self.out_map['SECRET_KEY'] = self.create_rgw_admin_ops_user() + if self._arg_parser.dry_run: + self.create_rgw_admin_ops_user() + else: + self.out_map['ACCESS_KEY'], self.out_map['SECRET_KEY'] = self.create_rgw_admin_ops_user() if self._arg_parser.rgw_tls_cert_path: self.out_map['RGW_TLS_CERT'] = self.validate_rgw_endpoint_tls_cert()