summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/compute/v2/fakes.py
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2021-07-26 22:13:55 +0000
committermelanie witt <melwittt@gmail.com>2021-07-28 15:25:06 +0000
commited87f7949ef1ef580ed71b9820e16823c0466472 (patch)
tree0b8db9263ef3ba4dc4b6129379f90a73aa2308ff /openstackclient/tests/unit/compute/v2/fakes.py
parent59256becc93d7953f983e0fbbdef098fefba73ff (diff)
downloadpython-openstackclient-ed87f7949ef1ef580ed71b9820e16823c0466472.tar.gz
Correct REST API response fields for /os-migrations API
The compute APIs are unfortunately inconsistent with regard to the response parameters for migrations. * GET /servers/{server_id}/migrations returns server_uuid * GET /os-migrations returns instance_uuid Because the 'Server UUID' column is being specified for parsing the response from GET /os-migrations, it is always showing as an empty string to users. There are a few other mismatches between the column names and the REST API response fields [1]: * 'Old Flavor' vs 'old_instance_type_id' * 'New Flavor' vs 'new_instance_type_id' * 'Type' vs 'migration_type' This adds a new list containing the REST API response field names to pass to utils.get_item_properties so that the responses are correctly parsed and the client output contains the response data instead of empty strings. Story: 2009078 Task: 42890 [1] https://docs.openstack.org/api-ref/compute/?expanded=list-migrations-detail#list-migrations Change-Id: I8aab60619e0225047f6a1c31e44917ca8fcc799e
Diffstat (limited to 'openstackclient/tests/unit/compute/v2/fakes.py')
-rw-r--r--openstackclient/tests/unit/compute/v2/fakes.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/openstackclient/tests/unit/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py
index 4a2a44de..47457acb 100644
--- a/openstackclient/tests/unit/compute/v2/fakes.py
+++ b/openstackclient/tests/unit/compute/v2/fakes.py
@@ -1587,20 +1587,20 @@ class FakeMigration(object):
migration_info = {
"dest_host": "10.0.2.15",
"status": "migrating",
- "type": "migration",
+ "migration_type": "migration",
"updated_at": "2017-01-31T08:03:25.000000",
"created_at": "2017-01-31T08:03:21.000000",
"dest_compute": "compute-" + uuid.uuid4().hex,
"id": random.randint(1, 999),
"source_node": "node-" + uuid.uuid4().hex,
- "server": uuid.uuid4().hex,
+ "instance_uuid": uuid.uuid4().hex,
"dest_node": "node-" + uuid.uuid4().hex,
"source_compute": "compute-" + uuid.uuid4().hex,
"uuid": uuid.uuid4().hex,
"old_instance_type_id": uuid.uuid4().hex,
"new_instance_type_id": uuid.uuid4().hex,
- "project": uuid.uuid4().hex,
- "user": uuid.uuid4().hex
+ "project_id": uuid.uuid4().hex,
+ "user_id": uuid.uuid4().hex
}
# Overwrite default attributes.