From 8193f5f38b3a74bb68595c2c7f865461647900b6 Mon Sep 17 00:00:00 2001 From: Vladimir Vechkanov Date: Wed, 8 Oct 2014 04:14:18 -0400 Subject: [PATCH] Add share network id field in share server info In share server responce in manila api only information about share network name is exist. But name can be different. That's why separate field with share network id is added. Change-Id: Iac429a2d38f9565239d08d57a8f6cece696124a1 Closes-Bug: #1378687 --- manila/api/views/share_servers.py | 1 + manila/tests/api/v1/test_share_servers.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/manila/api/views/share_servers.py b/manila/api/views/share_servers.py index 365db4e61c..73e786ce52 100644 --- a/manila/api/views/share_servers.py +++ b/manila/api/views/share_servers.py @@ -46,6 +46,7 @@ class ViewBuilder(common.ViewBuilder): 'status': share_server.status, 'host': share_server.host, 'share_network_name': share_server.share_network_name, + 'share_network_id': share_server.share_network_id, } if detailed: share_server_dict['created_at'] = share_server.created_at diff --git a/manila/tests/api/v1/test_share_servers.py b/manila/tests/api/v1/test_share_servers.py index 733232352d..910b48bd73 100644 --- a/manila/tests/api/v1/test_share_servers.py +++ b/manila/tests/api/v1/test_share_servers.py @@ -31,6 +31,7 @@ fake_share_server_list = { 'status': constants.STATUS_ACTIVE, 'updated_at': None, 'host': 'fake_host', + 'share_network_id': 'fake_sn_id', 'share_network_name': 'fake_sn_name', 'project_id': 'fake_project_id', 'id': 'fake_server_id', @@ -39,6 +40,7 @@ fake_share_server_list = { 'status': constants.STATUS_ERROR, 'updated_at': None, 'host': 'fake_host_2', + 'share_network_id': 'fake_sn_id_2', 'share_network_name': 'fake_sn_id_2', 'project_id': 'fake_project_id_2', 'id': 'fake_server_id_2', @@ -54,6 +56,7 @@ fake_share_server_get_result = { 'updated_at': None, 'host': 'fake_host', 'share_network_name': 'fake_sn_name', + 'share_network_id': 'fake_sn_id', 'project_id': 'fake_project_id', 'id': 'fake_server_id', 'backend_details': {