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 <vavuthu@redhat.com>
This commit is contained in:
vavuthu committed 2022-03-10 14:16:13 +05:30
1 parent ce98b17bf7
commit 149beedf20
1 file changed
+4 -1
@@ -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()