From f7a31857ef246e93f5dcf517c18dd1c62394ec2e Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sep 26 2017 22:57:38 +0000 Subject: Merge remote-tracking branch 'origin/master' into el6 --- diff --git a/.gitignore b/.gitignore index a080804..4707613 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ /ansible-2.3.0.0.tar.gz /ansible-2.3.1.0.tar.gz /ansible-2.3.2.0.tar.gz +/ansible-2.4.0.0.tar.gz diff --git a/30568.patch b/30568.patch new file mode 100644 index 0000000..b1991e6 --- /dev/null +++ b/30568.patch @@ -0,0 +1,169 @@ +From 4a407ade9f00d9731df1b588d120b1634f07af4c Mon Sep 17 00:00:00 2001 +From: Toshio Kuratomi +Date: Tue, 19 Sep 2017 11:51:07 -0700 +Subject: [PATCH] Fix jenkins_plugin test for no net situations + +Unittests are sometimes run without network connectivity in build +systems. Make that work correctly by mocking out _get_url_data with the +expected return value. +--- + .../web_infrastructure/test_jenkins_plugin.py | 127 ++++++++++++++++++++- + 1 file changed, 122 insertions(+), 5 deletions(-) + +diff --git a/test/units/modules/web_infrastructure/test_jenkins_plugin.py b/test/units/modules/web_infrastructure/test_jenkins_plugin.py +index c7955b684f1d0..ea3adce478745 100644 +--- a/test/units/modules/web_infrastructure/test_jenkins_plugin.py ++++ b/test/units/modules/web_infrastructure/test_jenkins_plugin.py +@@ -1,5 +1,5 @@ + import collections +-import mock ++from io import BytesIO + + from ansible.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin + +@@ -8,24 +8,141 @@ def pass_function(*args, **kwargs): + pass + + ++GITHUB_DATA = {"url": u'https://api.github.com/repos/ansible/ansible', ++ "response": b""" ++{ ++ "id": 3638964, ++ "name": "ansible", ++ "full_name": "ansible/ansible", ++ "owner": { ++ "login": "ansible", ++ "id": 1507452, ++ "avatar_url": "https://avatars2.githubusercontent.com/u/1507452?v=4", ++ "gravatar_id": "", ++ "url": "https://api.github.com/users/ansible", ++ "html_url": "https://github.com/ansible", ++ "followers_url": "https://api.github.com/users/ansible/followers", ++ "following_url": "https://api.github.com/users/ansible/following{/other_user}", ++ "gists_url": "https://api.github.com/users/ansible/gists{/gist_id}", ++ "starred_url": "https://api.github.com/users/ansible/starred{/owner}{/repo}", ++ "subscriptions_url": "https://api.github.com/users/ansible/subscriptions", ++ "organizations_url": "https://api.github.com/users/ansible/orgs", ++ "repos_url": "https://api.github.com/users/ansible/repos", ++ "events_url": "https://api.github.com/users/ansible/events{/privacy}", ++ "received_events_url": "https://api.github.com/users/ansible/received_events", ++ "type": "Organization", ++ "site_admin": false ++ }, ++ "private": false, ++ "html_url": "https://github.com/ansible/ansible", ++ "description": "Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy.", ++ "fork": false, ++ "url": "https://api.github.com/repos/ansible/ansible", ++ "forks_url": "https://api.github.com/repos/ansible/ansible/forks", ++ "keys_url": "https://api.github.com/repos/ansible/ansible/keys{/key_id}", ++ "collaborators_url": "https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}", ++ "teams_url": "https://api.github.com/repos/ansible/ansible/teams", ++ "hooks_url": "https://api.github.com/repos/ansible/ansible/hooks", ++ "issue_events_url": "https://api.github.com/repos/ansible/ansible/issues/events{/number}", ++ "events_url": "https://api.github.com/repos/ansible/ansible/events", ++ "assignees_url": "https://api.github.com/repos/ansible/ansible/assignees{/user}", ++ "branches_url": "https://api.github.com/repos/ansible/ansible/branches{/branch}", ++ "tags_url": "https://api.github.com/repos/ansible/ansible/tags", ++ "blobs_url": "https://api.github.com/repos/ansible/ansible/git/blobs{/sha}", ++ "git_tags_url": "https://api.github.com/repos/ansible/ansible/git/tags{/sha}", ++ "git_refs_url": "https://api.github.com/repos/ansible/ansible/git/refs{/sha}", ++ "trees_url": "https://api.github.com/repos/ansible/ansible/git/trees{/sha}", ++ "statuses_url": "https://api.github.com/repos/ansible/ansible/statuses/{sha}", ++ "languages_url": "https://api.github.com/repos/ansible/ansible/languages", ++ "stargazers_url": "https://api.github.com/repos/ansible/ansible/stargazers", ++ "contributors_url": "https://api.github.com/repos/ansible/ansible/contributors", ++ "subscribers_url": "https://api.github.com/repos/ansible/ansible/subscribers", ++ "subscription_url": "https://api.github.com/repos/ansible/ansible/subscription", ++ "commits_url": "https://api.github.com/repos/ansible/ansible/commits{/sha}", ++ "git_commits_url": "https://api.github.com/repos/ansible/ansible/git/commits{/sha}", ++ "comments_url": "https://api.github.com/repos/ansible/ansible/comments{/number}", ++ "issue_comment_url": "https://api.github.com/repos/ansible/ansible/issues/comments{/number}", ++ "contents_url": "https://api.github.com/repos/ansible/ansible/contents/{+path}", ++ "compare_url": "https://api.github.com/repos/ansible/ansible/compare/{base}...{head}", ++ "merges_url": "https://api.github.com/repos/ansible/ansible/merges", ++ "archive_url": "https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}", ++ "downloads_url": "https://api.github.com/repos/ansible/ansible/downloads", ++ "issues_url": "https://api.github.com/repos/ansible/ansible/issues{/number}", ++ "pulls_url": "https://api.github.com/repos/ansible/ansible/pulls{/number}", ++ "milestones_url": "https://api.github.com/repos/ansible/ansible/milestones{/number}", ++ "notifications_url": "https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}", ++ "labels_url": "https://api.github.com/repos/ansible/ansible/labels{/name}", ++ "releases_url": "https://api.github.com/repos/ansible/ansible/releases{/id}", ++ "deployments_url": "https://api.github.com/repos/ansible/ansible/deployments", ++ "created_at": "2012-03-06T14:58:02Z", ++ "updated_at": "2017-09-19T18:10:54Z", ++ "pushed_at": "2017-09-19T18:04:51Z", ++ "git_url": "git://github.com/ansible/ansible.git", ++ "ssh_url": "git@github.com:ansible/ansible.git", ++ "clone_url": "https://github.com/ansible/ansible.git", ++ "svn_url": "https://github.com/ansible/ansible", ++ "homepage": "https://www.ansible.com/", ++ "size": 91174, ++ "stargazers_count": 25552, ++ "watchers_count": 25552, ++ "language": "Python", ++ "has_issues": true, ++ "has_projects": true, ++ "has_downloads": true, ++ "has_wiki": false, ++ "has_pages": false, ++ "forks_count": 8893, ++ "mirror_url": null, ++ "open_issues_count": 4283, ++ "forks": 8893, ++ "open_issues": 4283, ++ "watchers": 25552, ++ "default_branch": "devel", ++ "organization": { ++ "login": "ansible", ++ "id": 1507452, ++ "avatar_url": "https://avatars2.githubusercontent.com/u/1507452?v=4", ++ "gravatar_id": "", ++ "url": "https://api.github.com/users/ansible", ++ "html_url": "https://github.com/ansible", ++ "followers_url": "https://api.github.com/users/ansible/followers", ++ "following_url": "https://api.github.com/users/ansible/following{/other_user}", ++ "gists_url": "https://api.github.com/users/ansible/gists{/gist_id}", ++ "starred_url": "https://api.github.com/users/ansible/starred{/owner}{/repo}", ++ "subscriptions_url": "https://api.github.com/users/ansible/subscriptions", ++ "organizations_url": "https://api.github.com/users/ansible/orgs", ++ "repos_url": "https://api.github.com/users/ansible/repos", ++ "events_url": "https://api.github.com/users/ansible/events{/privacy}", ++ "received_events_url": "https://api.github.com/users/ansible/received_events", ++ "type": "Organization", ++ "site_admin": false ++ }, ++ "network_count": 8893, ++ "subscribers_count": 1733 ++} ++""" ++ } ++ ++ + def test__get_json_data(mocker): + "test the json conversion of _get_url_data" + +- url = 'https://api.github.com/repos/ansible/ansible' + timeout = 30 + params = { +- 'url': url, ++ 'url': GITHUB_DATA['url'], + 'timeout': timeout + } +- module = mock.Mock() ++ module = mocker.Mock() + module.params = params + + JenkinsPlugin._csrf_enabled = pass_function + JenkinsPlugin._get_installed_plugins = pass_function ++ JenkinsPlugin._get_url_data = mocker.Mock() ++ JenkinsPlugin._get_url_data.return_value = BytesIO(GITHUB_DATA['response']) + jenkins_plugin = JenkinsPlugin(module) + + json_data = jenkins_plugin._get_json_data( +- "{url}".format(url=url), ++ "{url}".format(url=GITHUB_DATA['url']), + 'CSRF') + + assert isinstance(json_data, collections.Mapping) diff --git a/ansible-newer-jinja.patch b/ansible-newer-jinja.patch index 575c161..815b411 100644 --- a/ansible-newer-jinja.patch +++ b/ansible-newer-jinja.patch @@ -1,6 +1,6 @@ -diff -up ansible-2.3.0.0/requirements.txt.bak ansible-2.3.0.0/requirements.txt ---- ansible-2.3.0.0/requirements.txt.bak 2017-04-12 08:37:59.217167604 -0700 -+++ ansible-2.3.0.0/requirements.txt 2017-04-12 08:38:33.969286602 -0700 +diff -Nur ansible-2.4.0.0.orig/requirements.txt ansible-2.4.0.0/requirements.txt +--- ansible-2.4.0.0.orig/requirements.txt 2017-09-18 19:57:14.000000000 -0700 ++++ ansible-2.4.0.0/requirements.txt 2017-09-24 12:06:01.891861185 -0700 @@ -3,7 +3,7 @@ # packages. Thus, this should be the loosest set possible (only required # packages, not optional ones, and with the widest range of versions that could @@ -9,4 +9,4 @@ diff -up ansible-2.3.0.0/requirements.txt.bak ansible-2.3.0.0/requirements.txt +jinja2 >= 2.6 PyYAML paramiko - pycrypto >= 2.6 + cryptography diff --git a/ansible.spec b/ansible.spec index 7c8928b..6700357 100644 --- a/ansible.spec +++ b/ansible.spec @@ -19,13 +19,15 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Name: ansible Summary: SSH-based configuration management, deployment, and task execution system -Version: 2.3.2.0 -Release: 1%{?dist} +Version: 2.4.0.0 +Release: 2%{?dist} Group: Development/Libraries License: GPLv3+ Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz +# jenkins test tries to download data from github. +Patch0: https://patch-diff.githubusercontent.com/raw/ansible/ansible/pull/30568.patch # Patch to utilize a newer jinja2 package on epel6 # Non-upstreamable as it creates a dependency on a specific version of jinja. # This is desirable for us as we have packages for that version but not for @@ -35,16 +37,6 @@ Patch100: ansible-newer-jinja.patch Url: http://ansible.com BuildArch: noarch -%if 0%{?rhel} && 0%{?rhel} <= 5 -BuildRequires: python26-devel - -Requires: python26-PyYAML -Requires: python26-paramiko -Requires: python26-jinja2 -Requires: python26-keyczar - -%else - BuildRequires: python2-devel BuildRequires: python-setuptools @@ -99,7 +91,10 @@ Requires: python-httplib2 Requires: python-setuptools Requires: python-six Requires: sshpass + +%if (0%{?fedora} || 0%{?rhel} > 6) # needed for json_query filter +# but avoid on rhel6 due to amazon linux conflicts Requires: python2-jmespath %endif @@ -211,6 +206,7 @@ This package installs extensive documentation for ansible %prep %setup -q +%patch0 -p1 %if 0%{?rhel} == 6 %patch100 -p1 %endif @@ -325,6 +321,13 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Mon Sep 25 2017 Kevin Fenzi - 2.4.0.0-2 +- Rebase rhel6 jinja2 patch. +- Conditionalize jmespath to work around amazon linux issues. Fixes bug #1494640 + +* Tue Sep 19 2017 Kevin Fenzi - 2.4.0.0-1 +- Update to 2.4.0. + * Tue Aug 08 2017 Kevin Fenzi - 2.3.2.0-1 - Update to 2.3.2. Fixes bugs #1471017 #1461116 #1465586 diff --git a/sources b/sources index 6532af3..e0df187 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-2.3.2.0.tar.gz) = 458506da8ae65a80b442834c6047f02eb92acf9f7dd4465c63b4360c4c4817a0f7c48c92a614b91760a54d036ed13f417edf3524bb8a34a8a53ceb11efc928ac +SHA512 (ansible-2.4.0.0.tar.gz) = 78717b19599bdd46a7285b0b2a4c9d0d5b4cb86fd41dcf0b3340cf65945a55fae4508097058098fbeab871422c31d4f37ab4cd149abfd0af5add6004f65a207b