[Debian-ha-commits] [fence-agents] 04/09: Switch the agents to python3

Valentin Vidic vvidic-guest at moszumanska.debian.org
Sat Feb 10 10:21:24 UTC 2018


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository fence-agents.

commit 720b66bc4c53a42ee1ac7068693e83f583f2a5b5
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Sat Feb 10 10:30:21 2018 +0100

    Switch the agents to python3
---
 debian/control         | 24 ++++++++++++++----------
 debian/patches/python3 | 26 ++++++++++++++++++++++++++
 debian/patches/series  |  1 +
 debian/rules           |  9 +++++----
 4 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/debian/control b/debian/control
index daaea9a..1c89cd2 100644
--- a/debian/control
+++ b/debian/control
@@ -13,11 +13,13 @@ Build-Depends: autoconf,
                libnss3-dev,
                libtool,
                perl,
-               python,
-               python-pexpect,
-               python-pycurl,
-               python-requests,
-               python-suds,
+               python3,
+               python3-boto3,
+               python3-googleapi,
+               python3-pexpect,
+               python3-pycurl,
+               python3-requests,
+               python3-suds,
                time,
                xsltproc,
                libxml2-utils,
@@ -30,9 +32,11 @@ XS-Testsuite: autopkgtest
 
 Package: fence-agents
 Architecture: any
-Depends: ${misc:Depends}, ${perl:Depends}, ${python:Depends}, ${shlibs:Depends},
-         python-pycurl,
-         python-pexpect,
+Depends: ${misc:Depends}, ${perl:Depends}, ${python3:Depends}, ${shlibs:Depends},
+         python3-boto3,
+         python3-googleapi,
+         python3-pycurl,
+         python3-pexpect,
 Replaces: cman (<= 3.0.12-2ubuntu4)
 Conflicts: cman (<= 3.0.12-2ubuntu4)
 Recommends: libnet-telnet-perl,
@@ -40,8 +44,8 @@ Recommends: libnet-telnet-perl,
             sg3-utils,
             snmp
 # Needed by fence_vmware_soap:
-Suggests: python-requests,
-          python-suds
+Suggests: python3-requests,
+          python3-suds
 Description: Fence Agents for Red Hat Cluster
  Red Hat Fence Agents is a collection of scripts to handle remote
  power management for several devices.  They allow failed or
diff --git a/debian/patches/python3 b/debian/patches/python3
new file mode 100644
index 0000000..58b2a18
--- /dev/null
+++ b/debian/patches/python3
@@ -0,0 +1,26 @@
+Description: Make sure all agents use and work with python3
+ Small fixes for agents to use python3 and have correct syntax
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Bug: https://github.com/ClusterLabs/fence-agents/pull/170
+Last-Update: 2018-02-10
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/fence/agents/heuristics_ping/fence_heuristics_ping.py
++++ b/fence/agents/heuristics_ping/fence_heuristics_ping.py
+@@ -72,7 +72,7 @@
+ 			p[target].wait()
+ 			if p[target].returncode == 0:
+ 				for line in p[target].stdout:
+-					searchres = packet_count.search(line)
++					searchres = packet_count.search(line.decode())
+ 					if searchres:
+ 						good = int(searchres.group(1))
+ 						break
+--- a/fence/agents/powerman/fence_powerman.py
++++ b/fence/agents/powerman/fence_powerman.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!@PYTHON@ -tt
+ import os
+ import time
+ from datetime import datetime
diff --git a/debian/patches/series b/debian/patches/series
index dec0462..112386f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 remove-fence_amt_ws
 disable-network-access
+python3
diff --git a/debian/rules b/debian/rules
index 551e252..7a8bfbb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,7 @@ get-orig-source:
 	uscan --noconf --force-download --rename --repack --download-current-version --destdir=.
 
 %:
-	dh $@ --with python2
+	dh $@ --with python3
 
 override_dh_autoreconf:
 	dh_autoreconf ./autogen.sh
@@ -20,6 +20,7 @@ override_dh_auto_configure:
 		--bindir=/usr/bin \
 		--sbindir=/usr/sbin \
 		--libexecdir=/usr/lib/fence-agents \
+		PYTHON=/usr/bin/python3 \
 		VGS_PATH=/sbin/vgs
 
 override_dh_auto_install:
@@ -49,9 +50,9 @@ override_dh_auto_test:
 	# disable testing for ovh as it tries to access SOAP service on www.ovh.com
 	dh_auto_test -- TEST_TARGET_SKIP=ovh/fence_ovh
 
-override_dh_python2:
-	dh_python2
-	dh_python2 /usr/share/fence
+override_dh_python3:
+	dh_python3
+	dh_python3 /usr/share/fence
 
 override_dh_gencontrol:
 	# extract agent descriptions for use in debian/control

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/fence-agents.git



More information about the Debian-HA-Commits mailing list