|
|
6a3e49 |
From 8db45537fb470624a754ea1243cc4f349a9b413d Mon Sep 17 00:00:00 2001
|
|
|
6a3e49 |
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
|
|
6a3e49 |
Date: Tue, 24 Jul 2018 13:10:41 +0200
|
|
|
6a3e49 |
Subject: [PATCH] fence_aliyun: fix CI and add Python detection
|
|
|
6a3e49 |
|
|
|
6a3e49 |
---
|
|
|
6a3e49 |
agents/aliyun/fence_aliyun.py | 19 ++++++++++---------
|
|
|
6a3e49 |
tests/data/metadata/fence_aliyun.xml | 1 +
|
|
|
6a3e49 |
2 files changed, 11 insertions(+), 9 deletions(-)
|
|
|
6a3e49 |
|
|
|
6a3e49 |
diff --git a/agents/aliyun/fence_aliyun.py b/agents/aliyun/fence_aliyun.py
|
|
|
6a3e49 |
index 0f24b83e..aa6c0acf 100644
|
|
|
6a3e49 |
--- a/agents/aliyun/fence_aliyun.py
|
|
|
6a3e49 |
+++ b/agents/aliyun/fence_aliyun.py
|
|
|
6a3e49 |
@@ -1,14 +1,14 @@
|
|
|
6a3e49 |
-#!/usr/bin/python -tt
|
|
|
6a3e49 |
+#!@PYTHON@ -tt
|
|
|
6a3e49 |
|
|
|
6a3e49 |
-try:
|
|
|
6a3e49 |
- import sys, re
|
|
|
6a3e49 |
- import logging
|
|
|
6a3e49 |
- import atexit
|
|
|
6a3e49 |
- import json
|
|
|
6a3e49 |
- sys.path.append("@FENCEAGENTSLIBDIR@")
|
|
|
6a3e49 |
- from fencing import *
|
|
|
6a3e49 |
- from fencing import fail, fail_usage, EC_TIMED_OUT, run_delay
|
|
|
6a3e49 |
+import sys, re
|
|
|
6a3e49 |
+import logging
|
|
|
6a3e49 |
+import atexit
|
|
|
6a3e49 |
+import json
|
|
|
6a3e49 |
+sys.path.append("@FENCEAGENTSLIBDIR@")
|
|
|
6a3e49 |
+from fencing import *
|
|
|
6a3e49 |
+from fencing import fail, fail_usage, EC_TIMED_OUT, run_delay
|
|
|
6a3e49 |
|
|
|
6a3e49 |
+try:
|
|
|
6a3e49 |
from aliyunsdkcore import client
|
|
|
6a3e49 |
|
|
|
6a3e49 |
from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
|
|
|
6a3e49 |
@@ -17,6 +17,7 @@
|
|
|
6a3e49 |
from aliyunsdkecs.request.v20140526.RebootInstanceRequest import RebootInstanceRequest
|
|
|
6a3e49 |
except ImportError:
|
|
|
6a3e49 |
pass
|
|
|
6a3e49 |
+
|
|
|
6a3e49 |
def _send_request(conn, request):
|
|
|
6a3e49 |
request.set_accept_format('json')
|
|
|
6a3e49 |
try:
|
|
|
6a3e49 |
diff --git a/tests/data/metadata/fence_aliyun.xml b/tests/data/metadata/fence_aliyun.xml
|
|
|
6a3e49 |
index 1db692ee..b41d82bf 100644
|
|
|
6a3e49 |
--- a/tests/data/metadata/fence_aliyun.xml
|
|
|
6a3e49 |
+++ b/tests/data/metadata/fence_aliyun.xml
|
|
|
6a3e49 |
@@ -108,6 +108,7 @@
|
|
|
6a3e49 |
<action name="list-status" />
|
|
|
6a3e49 |
<action name="monitor" />
|
|
|
6a3e49 |
<action name="metadata" />
|
|
|
6a3e49 |
+ <action name="manpage" />
|
|
|
6a3e49 |
<action name="validate-all" />
|
|
|
6a3e49 |
</actions>
|
|
|
6a3e49 |
</resource-agent>
|