pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add a fix for Ansible bugid 3962: avoid "ascii coding error" by using unicode instead of str.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Mon Jun 27 10:13:51 2016 +0200
Changeset:	f2cbd7bb40f7a27ffd5c050f14f6d1572687b3c7

Modified Files:
	ansible/Makefile
	ansible/distinfo
Added Files:
	ansible/patches/patch-lib_ansible_module__utils_junos.py
	ansible/patches/patch-lib_ansible_modules_core_network_junos_junos__template.py

Log Message:
Add a fix for Ansible bugid 3962:
avoid "ascii coding error" by using unicode instead of str.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f2cbd7bb40f7a27ffd5c050f14f6d1572687b3c7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ansible/Makefile                                          |  2 +-
 ansible/distinfo                                          |  2 ++
 ansible/patches/patch-lib_ansible_module__utils_junos.py  | 15 +++++++++++++++
 ..._ansible_modules_core_network_junos_junos__template.py | 15 +++++++++++++++
 4 files changed, 33 insertions(+), 1 deletion(-)

diffs:
diff --git a/ansible/Makefile b/ansible/Makefile
index d45fd5c..5b6be13 100644
--- a/ansible/Makefile
+++ b/ansible/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.9 2016/02/24 22:32:59 tty Exp $
 
 DISTNAME=	ansible-2.1.0.0
-#PKGREVISION=	1
+PKGREVISION=	1
 #PKGNAME=	${PYPKGPREFIX}-${DISTNAME} # XXX: for when package is py3x-ready
 CATEGORIES=	python sysutils
 MASTER_SITES=	http://releases.ansible.com/ansible/
diff --git a/ansible/distinfo b/ansible/distinfo
index 1e47eae..3b70ddf 100644
--- a/ansible/distinfo
+++ b/ansible/distinfo
@@ -24,6 +24,8 @@ SHA1 (patch-examples_ansible.cfg) = 72de9cbce69150a6718439ed46de0816fc17102c
 SHA1 (patch-examples_hosts) = d6df854be7ea6fa4978681238f722cc9698bd34e
 SHA1 (patch-lib_ansible_cli_galaxy.py) = deabc09994f6e55cd5152dc5da07e852e097b073
 SHA1 (patch-lib_ansible_constants.py) = 2749d773973d7fd93af77f4879c64aad7b2570af
+SHA1 (patch-lib_ansible_module__utils_junos.py) = c8a111b38087559f8317e1805271cbcd7886f138
+SHA1 (patch-lib_ansible_modules_core_network_junos_junos__template.py) = e0c74d47aed32e41f450dc141da9eb90a73a7f35
 SHA1 (patch-lib_ansible_modules_core_system_ping.py) = 5fbb798d79e22de60ec736a7e7e96be0fadf4b1f
 SHA1 (patch-lib_ansible_modules_core_system_setup.py) = aece6abe6b7a4464bc86a48b5a289ba04093b193
 SHA1 (patch-lib_ansible_modules_extras_monitoring_nagios.py) = d263a9414d9fdd3c061d7ef2653f0ef648bf359b
diff --git a/ansible/patches/patch-lib_ansible_module__utils_junos.py b/ansible/patches/patch-lib_ansible_module__utils_junos.py
new file mode 100644
index 0000000..542676b
--- /dev/null
+++ b/ansible/patches/patch-lib_ansible_module__utils_junos.py
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add fix related to ansible bugid 3962.
+
+--- lib/ansible/module_utils/junos.py.orig	2016-05-25 13:00:55.000000000 +0000
++++ lib/ansible/module_utils/junos.py
+@@ -261,7 +261,7 @@ class Netconf(object):
+ 
+         ele = self.rpc('get_configuration', format=config_format)
+         if config_format in ['text', 'set']:
+-           return str(ele.text).strip()
++           return unicode(ele.text).strip()
+         elif config_format == "xml":
+             return ele
+ 
diff --git a/ansible/patches/patch-lib_ansible_modules_core_network_junos_junos__template.py b/ansible/patches/patch-lib_ansible_modules_core_network_junos_junos__template.py
new file mode 100644
index 0000000..75e58a0
--- /dev/null
+++ b/ansible/patches/patch-lib_ansible_modules_core_network_junos_junos__template.py
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add fix related to ansible bugid 3962.  
+
+--- lib/ansible/modules/core/network/junos/junos_template.py.orig	2016-05-25 13:00:59.000000000 +0000
++++ lib/ansible/modules/core/network/junos/junos_template.py
+@@ -132,7 +132,7 @@ def main():
+             "set per junos documentation")
+ 
+     results = dict(changed=False)
+-    results['_backup'] = str(module.get_config()).strip()
++    results['_backup'] = unicode(module.get_config()).strip()
+ 
+     diff = module.load_config(src, action=action, comment=comment,
+             format=fmt, commit=commit, confirm=confirm)


Home | Main Index | Thread Index | Old Index