summaryrefslogtreecommitdiffstats
path: root/debian/patches/logging-warn-deprecated
blob: 77ab20660a2533995887415d0aace894a70d5918 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Description: Replace deprecated logging function
Author: Valentin Vidic <vvidic@debian.org>
Last-Update: 2022-05-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/agents/aliyun/fence_aliyun.py
+++ b/agents/aliyun/fence_aliyun.py
@@ -15,7 +15,7 @@
 	from aliyunsdkcore.auth.credentials import EcsRamRoleCredential
 	from aliyunsdkcore.profile import region_provider
 except ImportError as e:
-	logging.warn("The 'aliyunsdkcore' module has been not installed or is unavailable, try to execute the command 'pip install aliyun-python-sdk-core --upgrade' to solve. error: %s" % e)
+	logging.warning("The 'aliyunsdkcore' module has been not installed or is unavailable, try to execute the command 'pip install aliyun-python-sdk-core --upgrade' to solve. error: %s" % e)
 
 
 try:
@@ -24,7 +24,7 @@
 	from aliyunsdkecs.request.v20140526.StopInstanceRequest import StopInstanceRequest
 	from aliyunsdkecs.request.v20140526.RebootInstanceRequest import RebootInstanceRequest
 except ImportError as e:
-	logging.warn("The 'aliyunsdkecs' module has been not installed or is unavailable, try to execute the command 'pip install aliyun-python-sdk-ecs --upgrade' to solve. error: %s" % e)
+	logging.warning("The 'aliyunsdkecs' module has been not installed or is unavailable, try to execute the command 'pip install aliyun-python-sdk-ecs --upgrade' to solve. error: %s" % e)
 
 
 def _send_request(conn, request):
@@ -182,7 +182,7 @@
 		try:
 			region_provider.modify_point('Ecs', region, 'ecs.%s.aliyuncs.com' % region)
 		except Exception as e:
-			logging.warn("Failed: failed to modify endpoint to 'ecs.%s.aliyuncs.com': %s" % (region, e))
+			logging.warning("Failed: failed to modify endpoint to 'ecs.%s.aliyuncs.com': %s" % (region, e))
 
 	# Operate the fencing device
 	result = fence_action(conn, options, set_power_status, get_power_status, get_nodes_list)
--- a/agents/compute/fence_compute.py
+++ b/agents/compute/fence_compute.py
@@ -98,7 +98,7 @@
 			# Since it's about forcing back to a default value, there is
 			# no real worries to just consider it's still okay even if the
 			# command failed
-			logging.warn("Exception from attempt to force "
+			logging.warning("Exception from attempt to force "
 				      "host back up via nova API: "
 				      "%s: %s" % (e.__class__.__name__, e))
 
--- a/agents/sbd/fence_sbd.py
+++ b/agents/sbd/fence_sbd.py
@@ -170,7 +170,7 @@
         if "msgwait" in line:
             tmp_msg_timeout = int(line.split(':')[1])
             if -1 != msg_timeout and tmp_msg_timeout != msg_timeout:
-                logging.warn(\
+                logging.warning(\
                         "sbd message timeouts differ in different devices")
             # we only save the highest timeout
             if tmp_msg_timeout > msg_timeout:
@@ -418,7 +418,7 @@
     power_timeout = int(options["--power-timeout"])
     sbd_msg_timeout = get_msg_timeout(options)
     if 0 < power_timeout <= sbd_msg_timeout:
-        logging.warn("power timeout needs to be \
+        logging.warning("power timeout needs to be \
                 greater then sbd message timeout")
 
     result = fence_action(\