Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/salt/files/, app-admin/salt/
Date: Fri, 02 Dec 2016 00:50:52
Message-Id: 1480639668.c6aba8cba0a877b64dcf80c75265e1aa59a8acc7.chutzpah@gentoo
1 commit: c6aba8cba0a877b64dcf80c75265e1aa59a8acc7
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 2 00:47:48 2016 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 2 00:47:48 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6aba8cb
7
8 app-admin/salt: Version bump to 2016.11.0
9
10 Package-Manager: portage-2.3.2
11
12 app-admin/salt/Manifest | 1 +
13 .../salt/files/salt-2016.11.0-broken-tests.patch | 23 ++++
14 .../salt-2016.11.0-remove-file-tree-test.patch | 34 +++++
15 app-admin/salt/files/salt-2016.11.0-tmpdir.patch | 34 +++++
16 app-admin/salt/salt-2016.11.0.ebuild | 144 +++++++++++++++++++++
17 5 files changed, 236 insertions(+)
18
19 diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest
20 index ab86693..589341d 100644
21 --- a/app-admin/salt/Manifest
22 +++ b/app-admin/salt/Manifest
23 @@ -1,3 +1,4 @@
24 DIST salt-2015.5.10.tar.gz 5693422 SHA256 863a96e70f8521af35fe11b10d25b3205a0bfbba9a8aee02e2842aa7106496fd SHA512 78a4cbe5c771208e957360689a25ae4e44566987e07e7fda54e6db9028485eacc6ad016c65c981090f9b5d95331e46048a094aecc27703b3956c06ab6ebad95d WHIRLPOOL 805b48df07707d85d8338251f26c72164a5421731fc11f5c933b72af97348a2f11ee35889f72ec032acbea275e98575d35786b56fd84a7917f8fdbc30567ae86
25 DIST salt-2015.8.12.tar.gz 7033938 SHA256 712f72b30a9555ea46a51bc677e05ffa2eefaeefa6b48d4f7ae45dbcb1073c69 SHA512 8ce940a413c740bd82c6c96103d48b376a47cb8161a5d72ece3f4bf6b39134bd722787a427249726dc137064d032fa913c7f6c6db22d0808ba1a829d4f25e9ec WHIRLPOOL 723660eac1346c3ba29b88c7db1a4485a194aebbdf33ea6dc411c420059767a3feb5c863941d772b504cede4a78a57e3ce696601872d21d29f4def373db697d4
26 +DIST salt-2016.11.0.tar.gz 9044879 SHA256 b516285926ee95cedc64ecddab05d14422b7c8819c9f6d046a431c41d608e6bc SHA512 0cddebe9fda1f7d08aa7ee5d4e49e182c67e7bc179136da30d20c991bc10d7299034198f6721b89eda2604480aa2cfe6960f37fadde4d72adf166a065a9f6443 WHIRLPOOL 595ab7c7e50cafdfc7d69a1e24964a88092e93416dc23b295e1ab59f1ce3ae8fa10b24c4e9fe45c1d2d8557290aceae66f93d3da81a1f1be62c98e537cb8ad6a
27 DIST salt-2016.3.4.tar.gz 8354090 SHA256 5d4c822719d7fb2d79b0103cd9b015d251300890f8aa174e16b73fcfd6eb22f9 SHA512 ca17c5607d23d09e95fb4b6afbcf1b4f0be6bab47ff3eee883c1464e13b5271b71f0e7bedfa8afe05f32bf3a0a6f4050a91afb9285b52aa0f3da6105221397e0 WHIRLPOOL 95347b1f8447e8701074727430ef0a232e92aa9e961451c445890552c6d9533569e470dfa4864f673c6c3b3eccb16ec9c3615cfcab6d29e74756861afe43fcac
28
29 diff --git a/app-admin/salt/files/salt-2016.11.0-broken-tests.patch b/app-admin/salt/files/salt-2016.11.0-broken-tests.patch
30 new file mode 100644
31 index 00000000..5bb7a8e
32 --- /dev/null
33 +++ b/app-admin/salt/files/salt-2016.11.0-broken-tests.patch
34 @@ -0,0 +1,23 @@
35 +diff --git a/tests/unit/utils/extend_test.py b/tests/unit/utils/extend_test.py
36 +index f63a4896f7..54bf443d9a 100644
37 +--- a/tests/unit/utils/extend_test.py
38 ++++ b/tests/unit/utils/extend_test.py
39 +@@ -38,18 +38,6 @@ class ExtendTestCase(TestCase):
40 + shutil.rmtree(self.out, True)
41 + os.chdir(self.starting_dir)
42 +
43 +- @patch('sys.exit', MagicMock)
44 +- def test_run(self):
45 +- out = salt.utils.extend.run('test', 'test', 'this description', integration.CODE_DIR, False)
46 +- self.out = out
47 +- year = date.today().strftime('%Y')
48 +- self.assertTrue(os.path.exists(out))
49 +- self.assertFalse(os.path.exists(os.path.join(out, 'template.yml')))
50 +- self.assertTrue(os.path.exists(os.path.join(out, 'directory')))
51 +- self.assertTrue(os.path.exists(os.path.join(out, 'directory', 'test.py')))
52 +- with salt.utils.fopen(os.path.join(out, 'directory', 'test.py'), 'r') as test_f:
53 +- self.assertEqual(test_f.read(), year)
54 +-
55 + if __name__ == '__main__':
56 + from unit import run_tests
57 + run_tests(ExtendTestCase, needs_daemon=False)
58
59 diff --git a/app-admin/salt/files/salt-2016.11.0-remove-file-tree-test.patch b/app-admin/salt/files/salt-2016.11.0-remove-file-tree-test.patch
60 new file mode 100644
61 index 00000000..47d3257
62 --- /dev/null
63 +++ b/app-admin/salt/files/salt-2016.11.0-remove-file-tree-test.patch
64 @@ -0,0 +1,34 @@
65 +diff --git a/tests/unit/modules/inspect_collector_test.py b/tests/unit/modules/inspect_collector_test.py
66 +index 9105670526..e077bc3f44 100644
67 +--- a/tests/unit/modules/inspect_collector_test.py
68 ++++ b/tests/unit/modules/inspect_collector_test.py
69 +@@ -52,29 +52,6 @@ class InspectorCollectorTestCase(TestCase):
70 + self.assertEqual(inspector.pidfile, '/foo/pid/bar.pid')
71 +
72 + @patch("os.mkdir", MagicMock())
73 +- def test_file_tree(self):
74 +- '''
75 +- Test file tree.
76 +-
77 +- :return:
78 +- '''
79 +-
80 +- inspector = Inspector(cachedir='/test', piddir='/test', pidfilename='bar.pid')
81 +- tree_root = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'inspectlib', 'tree_test')
82 +- expected_tree = (['/a/a/dummy.a', '/a/b/dummy.b', '/b/b.1', '/b/b.2', '/b/b.3'],
83 +- ['/a', '/a/a', '/a/b', '/a/c', '/b', '/c'],
84 +- ['/a/a/dummy.ln.a', '/a/b/dummy.ln.b', '/a/c/b.1', '/b/b.4',
85 +- '/b/b.5', '/c/b.1', '/c/b.2', '/c/b.3'])
86 +- tree_result = []
87 +- for chunk in inspector._get_all_files(tree_root):
88 +- buff = []
89 +- for pth in chunk:
90 +- buff.append(pth.replace(tree_root, ''))
91 +- tree_result.append(buff)
92 +- tree_result = tuple(tree_result)
93 +- self.assertEqual(expected_tree, tree_result)
94 +-
95 +- @patch("os.mkdir", MagicMock())
96 + def test_get_unmanaged_files(self):
97 + '''
98 + Test get_unmanaged_files.
99
100 diff --git a/app-admin/salt/files/salt-2016.11.0-tmpdir.patch b/app-admin/salt/files/salt-2016.11.0-tmpdir.patch
101 new file mode 100644
102 index 00000000..1cccb15
103 --- /dev/null
104 +++ b/app-admin/salt/files/salt-2016.11.0-tmpdir.patch
105 @@ -0,0 +1,34 @@
106 +diff --git a/tests/unit/modules/qemu_nbd_test.py b/tests/unit/modules/qemu_nbd_test.py
107 +index 615e6b5670..fbd24aab86 100644
108 +--- a/tests/unit/modules/qemu_nbd_test.py
109 ++++ b/tests/unit/modules/qemu_nbd_test.py
110 +@@ -77,6 +77,7 @@ class QemuNbdTestCase(TestCase):
111 + Test if it mount the named image via qemu-nbd
112 + and return the mounted roots
113 + '''
114 ++ tmpdir = os.environ.get('TMPDIR', '/tmp')
115 + mock = MagicMock(return_value=True)
116 + with patch.dict(qemu_nbd.__salt__, {'cmd.run': mock}):
117 + self.assertEqual(qemu_nbd.init('/srv/image.qcow2'), '')
118 +@@ -89,7 +90,7 @@ class QemuNbdTestCase(TestCase):
119 + 'mount.mount': mock,
120 + 'cmd.retcode': MagicMock(side_effect=[1, 0])}):
121 + self.assertDictEqual(qemu_nbd.init('/srv/image.qcow2'),
122 +- {'/tmp/nbd/nbd0/nbd0': '/dev/nbd0'})
123 ++ {os.path.join(tmpdir, 'nbd/nbd0/nbd0'): '/dev/nbd0'})
124 +
125 + # 'clear' function tests: 1
126 +
127 +diff --git a/tests/unit/utils/context_test.py b/tests/unit/utils/context_test.py
128 +index 5249d56747..a27ee9ab61 100644
129 +--- a/tests/unit/utils/context_test.py
130 ++++ b/tests/unit/utils/context_test.py
131 +@@ -18,7 +18,7 @@ import salt.payload
132 + import salt.utils
133 +
134 + __context__ = {'a': 'b'}
135 +-__opts__ = {'cachedir': '/tmp'}
136 ++__opts__ = {'cachedir': os.environ.get('TMPDIR', '/tmp')}
137 +
138 +
139 + @skipIf(NO_MOCK, NO_MOCK_REASON)
140
141 diff --git a/app-admin/salt/salt-2016.11.0.ebuild b/app-admin/salt/salt-2016.11.0.ebuild
142 new file mode 100644
143 index 00000000..c2db5f5
144 --- /dev/null
145 +++ b/app-admin/salt/salt-2016.11.0.ebuild
146 @@ -0,0 +1,144 @@
147 +# Copyright 1999-2016 Gentoo Foundation
148 +# Distributed under the terms of the GNU General Public License v2
149 +# $Id$
150 +
151 +EAPI=6
152 +PYTHON_COMPAT=( python2_7 )
153 +
154 +inherit eutils systemd distutils-r1
155 +
156 +DESCRIPTION="Salt is a remote execution and configuration manager"
157 +HOMEPAGE="http://saltstack.org/"
158 +
159 +if [[ ${PV} == 9999* ]]; then
160 + inherit git-r3
161 + EGIT_REPO_URI="git://github.com/${PN}stack/${PN}.git"
162 + EGIT_BRANCH="develop"
163 + SRC_URI=""
164 + KEYWORDS=""
165 +else
166 + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
167 + KEYWORDS="~x86 ~amd64"
168 +fi
169 +
170 +LICENSE="Apache-2.0"
171 +SLOT="0"
172 +IUSE="cherrypy ldap libcloud libvirt gnupg keyring mako mongodb mysql neutron nova"
173 +IUSE+=" openssl portage profile redis selinux test timelib raet +zeromq vim-syntax"
174 +
175 +RDEPEND="sys-apps/pciutils
176 + dev-python/jinja[${PYTHON_USEDEP}]
177 + >=dev-python/msgpack-0.3[${PYTHON_USEDEP}]
178 + dev-python/pyyaml[${PYTHON_USEDEP}]
179 + dev-python/markupsafe[${PYTHON_USEDEP}]
180 + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
181 + dev-python/setuptools[${PYTHON_USEDEP}]
182 + >=www-servers/tornado-4.2.1[${PYTHON_USEDEP}]
183 + virtual/python-futures[${PYTHON_USEDEP}]
184 + libcloud? ( >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] )
185 + mako? ( dev-python/mako[${PYTHON_USEDEP}] )
186 + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
187 + libvirt? ( dev-python/libvirt-python[${PYTHON_USEDEP}] )
188 + openssl? (
189 + dev-libs/openssl:*[-bindist]
190 + dev-python/pyopenssl[${PYTHON_USEDEP}]
191 + )
192 + raet? (
193 + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
194 + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
195 + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
196 + )
197 + zeromq? (
198 + >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}]
199 + >=dev-python/pycrypto-2.6.1[${PYTHON_USEDEP}]
200 + )
201 + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
202 + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
203 + portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
204 + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
205 + mysql? ( dev-python/mysql-python[${PYTHON_USEDEP}] )
206 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
207 + selinux? ( sec-policy/selinux-salt )
208 + timelib? ( dev-python/timelib[${PYTHON_USEDEP}] )
209 + nova? ( >=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}] )
210 + neutron? ( >=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}] )
211 + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
212 + profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
213 + vim-syntax? ( app-vim/salt-vim )"
214 +DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
215 + test? (
216 + dev-python/psutil[${PYTHON_USEDEP}]
217 + dev-python/pip[${PYTHON_USEDEP}]
218 + dev-python/virtualenv[${PYTHON_USEDEP}]
219 + dev-python/mock[${PYTHON_USEDEP}]
220 + dev-python/timelib[${PYTHON_USEDEP}]
221 + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
222 + !x86? ( dev-python/boto3[${PYTHON_USEDEP}] )
223 + >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
224 + >=dev-python/SaltTesting-2016.5.11[${PYTHON_USEDEP}]
225 + >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}]
226 + ${RDEPEND}
227 + )"
228 +
229 +DOCS=( README.rst AUTHORS )
230 +
231 +REQUIRED_USE="|| ( raet zeromq )"
232 +RESTRICT="x86? ( test )"
233 +
234 +PATCHES=(
235 + "${FILESDIR}/${PN}-2016.11.0-tmpdir.patch"
236 + "${FILESDIR}/${PN}-2016.3.1-dont-realpath-tmpdir.patch"
237 + "${FILESDIR}/${PN}-2016.3.4-test-nonexist-dirs.patch"
238 + "${FILESDIR}/${PN}-2016.11.0-remove-file-tree-test.patch"
239 + "${FILESDIR}/${PN}-2016.11.0-broken-tests.patch"
240 +)
241 +
242 +python_prepare() {
243 + # this test fails because it trys to "pip install distribute"
244 + rm tests/unit/{modules,states}/zcbuildout_test.py \
245 + tests/unit/modules/{rh_ip,win_network,random_org}_test.py || die
246 +
247 + # apparently libcloud does not know about this?
248 + rm tests/unit/cloud/clouds/dimensiondata_test.py || die
249 +
250 + # seriously? "ValueError: Missing (or not readable) key file: '/home/dany/PRIVKEY.pem'"
251 + rm tests/unit/cloud/clouds/gce_test.py || die
252 +}
253 +
254 +python_install_all() {
255 + local svc
256 + USE_SETUPTOOLS=1 distutils-r1_python_install_all
257 +
258 + for svc in minion master syndic api; do
259 + newinitd "${FILESDIR}"/${svc}-initd-4 salt-${svc}
260 + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
261 + systemd_dounit "${FILESDIR}"/salt-${svc}.service
262 + done
263 +
264 + insinto /etc/${PN}
265 + doins -r conf/*
266 +}
267 +
268 +python_test() {
269 + local tempdir
270 + # testsuite likes lots of files
271 + ulimit -n 3072 || die
272 +
273 + # ${T} is too long a path for the tests to work
274 + tempdir="$(mktemp -dup /tmp salt-XXX)"
275 + mkdir "${T}/$(basename "${tempdir}")"
276 +
277 + (
278 + cleanup() { rm -f "${tempdir}"; }
279 + trap cleanup EXIT
280 +
281 + addwrite "${tempdir}"
282 + ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}"
283 +
284 + USE_SETUPTOOLS=1 SHELL="/bin/bash" \
285 + TMPDIR="${tempdir}" \
286 + ${EPYTHON} tests/runtests.py \
287 + --unit-tests --no-report --verbose
288 +
289 + ) || die "testing failed"
290 +}