Skip to content

Commit

Permalink
Force currentValue and requested value to be string in changeset resp…
Browse files Browse the repository at this point in the history
…onse
  • Loading branch information
hgreebe committed Dec 4, 2024
1 parent 9d0edaa commit 2f6ca68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ def _analyze_changes(changes):
message = _create_message(row[key_indexes["reason"]], row[key_indexes["action_needed"]])
if not _cluster_update_change_succeded(check_result):
errors.append(
UpdateError(parameter=parameter, requested_value=new_value, message=message, current_value=old_value)
UpdateError(parameter=parameter, requested_value=str(new_value), message=message, current_value=str(old_value))
)
change_set.append(Change(parameter=parameter, requested_value=new_value, current_value=old_value))
change_set.append(Change(parameter=parameter, requested_value=str(new_value), current_value=str(old_value)))
return change_set, errors


Expand Down
8 changes: 3 additions & 5 deletions tests/integration-tests/tests/pcluster_api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def _test_cluster_workflow(
# Update cluster with new configuration
with open(updated_config_file, encoding="utf-8") as config_file:
updated_cluster_config = config_file.read()
_test_update_cluster_dryrun(region, cluster_operations_client, cluster_name, updated_cluster_config)
_test_update_cluster(region, cluster_operations_client, cluster_name, updated_cluster_config)

head_node = _test_describe_cluster_head_node(region, cluster_instances_client, cluster_name)
compute_node_map = _test_describe_cluster_compute_nodes(region, cluster_instances_client, cluster_name)
Expand Down Expand Up @@ -495,11 +495,9 @@ def _test_create_cluster(client, create_cluster, cluster_name, config):
return cluster


def _test_update_cluster_dryrun(region, client, cluster_name, config):
def _test_update_cluster(region, client, cluster_name, config):
body = UpdateClusterRequestContent(config)
error_message = "Request would have succeeded, but DryRun flag is set."
with pytest.raises(ApiException, match=error_message):
client.update_cluster(cluster_name, body, region=region, dryrun=True)
client.update_cluster(cluster_name, body, region=region, dryrun=False)


def _test_delete_cluster(region, client, cluster_name):
Expand Down

0 comments on commit 2f6ca68

Please sign in to comment.