diff --git a/osmclient/cli_commands/ksu.py b/osmclient/cli_commands/ksu.py index cea90052e31de1790305fb0d3b6e657e52d121ae..27f050db57131f954f90c9ec377d5a221796ae87 100755 --- a/osmclient/cli_commands/ksu.py +++ b/osmclient/cli_commands/ksu.py @@ -49,6 +49,13 @@ def verify_and_update_ksu(ctx, ksu): else: raise ClientException("Unexpected failure when reading the profile") + profile_type_mapping = { + "infra-controller-profile": "infra_controller_profiles", + "infra-config-profile": "infra_config_profiles", + "app-profile": "app_profiles", + "resource-profile": "resource_profiles", + } + logger.debug("") if "name" not in ksu: raise ClientException("A name must be provided for each KSU") @@ -64,6 +71,8 @@ def verify_and_update_ksu(ctx, ksu): ) else: raise ClientException("A profile id or name must be provided for each KSU") + # Finally update the profile type to use the string expected by NBI + ksu_profile["profile_type"] = profile_type_mapping[ksu_profile_type] else: raise ClientException("A profile must be provided for each KSU") if "oka" in ksu: diff --git a/osmclient/sol005/osm_api_object.py b/osmclient/sol005/osm_api_object.py index 4dfe4cd9f0223402343838a063893fd648813e9f..0c1ba1ea7a24852496067d438b2d86438dac09ce 100644 --- a/osmclient/sol005/osm_api_object.py +++ b/osmclient/sol005/osm_api_object.py @@ -181,7 +181,9 @@ class GenericOSMAPIObject(ABC): if not resp: raise ClientException(f"unexpected response from server - {resp}") resp = json.loads(resp) - print(resp) + # print(resp) + output = ",".join(resp["id"]) + print(output) elif http_code == 204: print("Received")