Blame SOURCES/bz1622229-1-fence_aliyun-list-instance-names.patch

554a6e
From c21d60fbcf0b11dcbf4f70006c8ffaeac4ca7dbd Mon Sep 17 00:00:00 2001
554a6e
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
554a6e
Date: Tue, 28 Aug 2018 15:20:10 +0200
554a6e
Subject: [PATCH] fence_aliyun: list instance names and show up to 100
554a6e
 instances
554a6e
554a6e
---
554a6e
 agents/aliyun/fence_aliyun.py | 4 +++-
554a6e
 1 file changed, 3 insertions(+), 1 deletion(-)
554a6e
554a6e
diff --git a/agents/aliyun/fence_aliyun.py b/agents/aliyun/fence_aliyun.py
554a6e
index 2cda6b7f..b3aca12f 100644
554a6e
--- a/agents/aliyun/fence_aliyun.py
554a6e
+++ b/agents/aliyun/fence_aliyun.py
554a6e
@@ -59,13 +59,15 @@ def get_status(conn, instance_id):
554a6e
 def get_nodes_list(conn, options):
554a6e
 	result = {}
554a6e
 	request = DescribeInstancesRequest()
554a6e
+	request.set_PageSize(100)
554a6e
 	response = _send_request(conn, request)
554a6e
 	instance_status = None
554a6e
 	if response is not None:
554a6e
 		instance_list = response.get('Instances').get('Instance')
554a6e
 		for item in instance_list:
554a6e
 			instance_id = item.get('InstanceId')
554a6e
-			result[instance_id] = ("", None)
554a6e
+			instance_name = item.get('InstanceName')
554a6e
+			result[instance_id] = (instance_name, None)
554a6e
 	return result
554a6e
 
554a6e
 def get_power_status(conn, options):