fence-agents/SOURCES/fence_aliyun-5-list-instance-names.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

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