Blame SOURCES/fence_aliyun-5-list-instance-names.patch

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