toshio pushed to ansible (el6). "Merge branch 'master' into el6"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri May 29 17:34:18 UTC 2015


From 8c2ef00c864ed125a254e4bfb77362e7c004e5ce Mon Sep 17 00:00:00 2001
From: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Wed, 27 May 2015 08:54:54 -0700
Subject: Fix for dnf failures in a couple large cornercases


diff --git a/ansible.spec b/ansible.spec
index d7fa55c..64cc026 100644
--- a/ansible.spec
+++ b/ansible.spec
@@ -10,11 +10,14 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 Name: ansible
 Summary: SSH-based configuration management, deployment, and task execution system
 Version: 1.9.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 Group: Development/Libraries
 License: GPLv3
 Source0: http://releases.ansible.com/ansible/%{name}-%{version}.tar.gz
+# The dnf module needs a rewrite.  This is upstream's bandaid until that
+# happens (patch applied upstream)
+Patch0: dnf-bandaid.patch
 Url: http://ansible.com
 
 BuildArch: noarch
@@ -69,6 +72,9 @@ are transferred to managed machines automatically.
 %prep
 %setup -q
 
+# Fix for dnf module
+%patch0 -p1
+
 %build
 %{__python} setup.py build
 
@@ -98,6 +104,9 @@ rm -rf $RPM_BUILD_ROOT
 %doc %{_mandir}/man1/ansible*
 
 %changelog
+* Wed May 27 2015 Toshio Kuratomi <toshio at fedoraproject.org> - 1.9.1-2
+- Fix for dnf
+
 * Tue Apr 28 2015 Kevin Fenzi <kevin at scrye.com> 1.9.1-1
 - Update to 1.9.1
 
diff --git a/dnf-bandaid.patch b/dnf-bandaid.patch
new file mode 100644
index 0000000..8be8ea9
--- /dev/null
+++ b/dnf-bandaid.patch
@@ -0,0 +1,61 @@
+diff -up ansible-1.9.1/lib/ansible/modules/extras/packaging/os/dnf.py.bak ansible-1.9.1/lib/ansible/modules/extras/packaging/os/dnf.py
+--- ansible-1.9.1/lib/ansible/modules/extras/packaging/os/dnf.py.bak	2015-04-28 11:42:28.000000000 -0700
++++ ansible-1.9.1/lib/ansible/modules/extras/packaging/os/dnf.py	2015-05-27 08:14:09.175829546 -0700
+@@ -92,8 +92,10 @@ options:
+ 
+ notes: []
+ # informational: requirements for nodes
+-requirements: [ dnf ]
+-author: Cristian van Ee
++requirements:
++  - dnf
++  - yum-utils (for repoquery)
++author: '"Cristian van Ee (@DJMuggs)" <cristian at cvee.org>'
+ '''
+ 
+ EXAMPLES = '''
+@@ -137,18 +139,12 @@ def log(msg):
+ def dnf_base(conf_file=None, cachedir=False):
+ 
+     my = dnf.Base()
+-    my.logging.verbose_level=0
+-    my.logging.verbose_level=0
++    my.conf.debuglevel=0
+     if conf_file and os.path.exists(conf_file):
+-        my.config = conf_file
+-    if cachedir or os.geteuid() != 0:
+-     if cachedir or os.geteuid() != 0:
+-         if hasattr(my, 'setCacheDir'):
+-             my.setCacheDir()
+-         else:
+-             cachedir = cachedir.dnf.Conf()
+-             my.repos.setCacheDir(cachedir)
+-             my.conf.cache = 0
++        my.conf.config_file_path = conf_file
++        my.conf.read()
++    my.read_all_repos()
++    my.fill_sack()
+ 
+     return my
+ 
+@@ -157,7 +153,7 @@ def install_dnf_utils(module):
+     if not module.check_mode:
+         dnf_path = module.get_bin_path('dnf')
+         if dnf_path:
+-            rc, so, se = module.run_command('%s -y install dnf-plugins-core' % dnf_path)
++            rc, so, se = module.run_command('%s -y install yum-utils' % dnf_path)
+             if rc == 0:
+                 this_path = module.get_bin_path('repoquery')
+                 global repoquery
+@@ -812,9 +808,9 @@ def main():
+     if params['install_repoquery'] and not repoquery and not module.check_mode:
+         install_dnf_utils(module)
+ 
++    if not repoquery:
++        module.fail_json(msg="repoquery is required to use this module at this time. Please install the yum-utils package.")
+     if params['list']:
+-        if not repoquery:
+-            module.fail_json(msg="repoquery is required to use list= with this module. Please install the dnf-utils package.")
+         results = dict(results=list_stuff(module, params['conf_file'], params['list']))
+         module.exit_json(**results)
+ 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/ansible.git/commit/?h=el6&id=5ad27aa5117527a9398d6ba11e5ce6fe4ea33dea


More information about the scm-commits mailing list