3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # pylint: disable=line-too-long,invalid-name
18 from copy import deepcopy
21 def _copy(d, pattern, repl):
23 for k, v in x.items():
24 if isinstance(v, str):
25 x[k] = re.sub(pattern, repl, v)
30 "Architecture": "noarch",
31 "Build Date": "Wed May 30 11:39:05 2018",
32 "Build Host": "crf-dev",
33 "Crypto capable": False,
34 "Description": "This is grafana, this is SPARTAAAAA!",
36 "From repo": "caas-artifactory",
37 "Group": "Unspecified",
38 "Install Date": "Sun Nov 18 22:15:41 2018",
40 "License": "Commercial",
41 "Name": "caas.grafana",
43 "Release": "1.el7.centos",
44 "Relocations": "(not relocatable)",
47 "baseurl": "http://files/20181023",
48 "name": "caas-artifactory"
50 "Signature": "(none)",
52 "Source RPM": "caas.grafana-4.4.1.9-1.el7.centos.src.rpm",
54 "baseurl": "http://files/20181023",
55 "name": "caas-artifactory"
57 "Source to be delivered": "No",
58 "Summary": "caasgrafana",
59 "Vendor": "Something",
66 "Source RPM": "caas.grafana-4.4.1.9-1.el7.centos.src.rpm",
67 "Source URL": "https://some/grafana/url",
71 caas_grafana1_sub_new_field = deepcopy(caas_grafana1_sub)
72 caas_grafana1_sub_new_field['ABC'] = True
74 caas_grafana2 = _copy(caas_grafana1, 'caas.grafana', 'caas.grafana2')
75 caas_grafana2_sub = _copy(caas_grafana1_sub, 'caas.grafana', 'caas.grafana2')
77 caas_grafana3 = _copy(caas_grafana1, 'caas.grafana', 'caas.grafana3')
78 caas_grafana3_sub = _copy(caas_grafana1_sub, 'caas.grafana', 'caas.grafana3')
80 caas_grafana1_v2 = _copy(caas_grafana1, '4.4.1.9', '4.4.1.10')
81 caas_grafana1_v2sub = _copy(caas_grafana1_sub, '4.4.1.9', '4.4.1.10')
83 caas_grafana1_r2 = _copy(caas_grafana1, '1.el7.centos', '2.el7.centos')
84 caas_grafana1_r2sub = _copy(caas_grafana1_sub, '1.el7.centos', '2.el7.centos')
87 "License": "Commercial",
91 "Source RPM": "caas-abc-v1-r1.src.rpm",
97 "Source RPM": "caas-abc-v1-r1.src.rpm",
99 caas_abc1_r2 = _copy(caas_abc1, 'r1', 'r2')
100 caas_abc1_sub_r2 = _copy(caas_abc1_sub, 'r1', 'r2')
107 "Source RPM": "abc-v1-r1.src.rpm",
109 abc1_v2 = _copy(abc1, 'v1', 'v2')
110 abc2 = _copy(abc1, 'abc', 'abc2')
111 abc3 = _copy(abc1, 'abc', 'abc3')
114 'Architecture': 'noarch',
115 'Build Date': 'Sun Nov 11 12:54:39 2018',
116 'Build Host': 'build-7.novalocal',
117 'Description': 'This RPM contains configuration management openstack configuration override '
120 'From repo': 'localrepo',
121 'Group': 'Unspecified',
122 'Install Date': 'Tue Nov 13 19:14:29 2018',
124 'License': 'Commercial',
125 'Name': 'openstack-config-overrides-validator',
127 'Packager': 'Something',
128 'Release': '1.el7.centos',
129 'Relocations': '(not relocatable)',
132 'baseurl': 'https://jenkins/ci-build/2490/artifact/results/repo',
133 'name': 'localrepo'},
134 'Signature': '(none)',
136 'Source RPM': 'openstack-config-overrides-validator-c2.gd1b7aec-1.el7.centos.src.rpm',
137 'Source repo data': {
138 'baseurl': 'https://jenkins/ci-build/2490/artifact/results/src_repo',
139 'name': 'localrepo'},
140 'Source to be delivered': 'No',
141 'Summary': 'Openstack configuration override CM validator plugin.',
142 'Vendor': 'Something',
143 'Version': 'c2.gd1b7aec'
146 component_removed = {
147 'Architecture': 'x86_64',
148 'Build Date': 'Thu Aug 16 14:46:11 2018',
149 'Build Host': 'x86-01.bsys.centos.org',
150 'Description': 'The fence-agents-ibmblade package contains a fence agent for IBM BladeCenter '
151 'devices that are accessed via the SNMP protocol.',
153 'From repo': 'purkki-centos-updates',
154 'Group': 'System Environment/Base',
155 'Install Date': 'Wed Nov 7 21:20:01 2018',
157 'License': 'GPLv2+ and LGPLv2+',
158 'Name': 'fence-agents-ibmblade',
159 'Obsoletes': 'fence-agents,',
160 'Packager': 'CentOS BuildSystem <http://bugs.centos.org>',
161 'Release': '86.el7_5.3',
162 'Relocations': '(not relocatable)',
165 'baseurl': 'http://purkki/mirror/centos/snapshot/20181024/7/updates/x86_64/',
166 'exclude': 'libgudev1 httpd httpd-devel systemd-libs.i686 resource-agents '
167 'dhcp-libs dhclient dhcp-common php-fpm php-common php-cli php',
168 'name': 'purkki-centos-updates'},
169 'Signature': 'RSA/SHA256, Mon Aug 20 14:15:17 2018, Key ID 24c6a8a7f4a80eb5',
171 'Source RPM': 'fence-agents-4.0.11-86.el7_5.3.src.rpm',
172 'Source repo data': {
173 'baseurl': 'http://purkki/mirror/centos/snapshot/20181024/7/updates/Source/',
174 'name': 'purkki-centos-updates'},
175 'Source to be delivered': 'Undefined',
176 'Summary': 'Fence agent for IBM BladeCenter',
177 'URL': 'https://github.com/ClusterLabs/fence-agents',
181 component_changed_old = {
182 'Architecture': 'noarch',
183 'Build Date': 'Fri Oct 19 00:22:00 2018',
184 'Build Host': 'f32725a719ce4c82a53b44644dfd2718',
185 'Description': 'This RPM contains source code for the Authentication, Authorization and '
188 'From repo': 'localrepo',
189 'Group': 'Unspecified',
190 'Install Date': 'Wed Nov 7 21:22:14 2018',
192 'License': 'Commercial',
195 'Packager': 'Something',
196 'Release': '2.el7.centos',
197 'Relocations': '(not relocatable)',
200 'baseurl': 'https://jenkins/ci-build/2432/artifact/results/repo',
201 'name': 'localrepo'},
202 'Signature': '(none)',
204 'Source RPM': 'aaacli-c12.gc62d348-2.el7.centos.src.rpm',
205 'Source repo data': {
206 'baseurl': 'https://jenkins/ci-build/2432/artifact/results/src_repo',
207 'name': 'localrepo'},
208 'Source to be delivered': 'No',
209 'Summary': 'Authentication, Authorization and Accounting Command Line Interface',
210 'Vendor': 'Something',
211 'Version': 'c12.gc62d348'
214 component_changed_new = {
215 'Architecture': 'noarch',
216 'Build Date': 'Thu Nov 8 05:05:07 2018',
217 'Build Host': 'build-3.novalocal',
218 'Description': 'This RPM contains source code for the Authentication, '
219 'Authorization and Accounting cli',
221 'From repo': 'localrepo',
222 'Group': 'Unspecified',
223 'Install Date': 'Tue Nov 13 19:09:30 2018',
225 'License': 'Commercial',
228 'Packager': 'Something',
229 'Release': '1.el7.centos',
230 'Relocations': '(not relocatable)',
233 'baseurl': 'https://jenkins/ci-build/2490/artifact/results/repo',
234 'name': 'localrepo'},
235 'Signature': '(none)',
237 'Source RPM': 'aaacli-c13.gcb6b490-1.el7.centos.src.rpm',
238 'Source repo data': {
239 'baseurl': 'https://jenkins/ci-build/2490/artifact/results/src_repo',
240 'name': 'localrepo'},
241 'Source to be delivered': 'No',
242 'Summary': 'Authentication, Authorization and Accounting Command Line Interface',
243 'Vendor': 'Something',
244 'Version': 'c13.gcb6b490'
248 'Architecture': 'x86_64',
249 'Build Date': 'Mon Sep 17 14:30:25 2018',
250 'Build Host': 'd8fb00edf57f4254bb45073a941929ff',
251 'Description': 'Grafana is an open source, feature rich metrics dashboard and graph '
252 'editor for\nGraphite, InfluxDB & OpenTSDB.',
254 'From repo': 'localrepo',
255 'Group': 'Unspecified',
256 'Install Date': 'Fri Nov 16 02:23:02 2018',
258 'License': 'Commercial and ASL 2.0 and others',
261 'Packager': 'Something',
262 'Release': '1.el7.centos.1',
263 'Relocations': '(not relocatable)',
266 'baseurl': 'https://jenkins/ci-build/2506/artifact/results/repo',
267 'name': 'localrepo'},
268 'Signature': '(none)',
270 'Source RPM': 'grafana-5.2.3-1.el7.centos.1.src.rpm',
271 'Source repo data': {
272 'baseurl': 'https://jenkins/ci-build/2506/artifact/results/src_repo',
273 'name': 'localrepo'},
274 'Source to be delivered': 'Upstream',
275 'Summary': 'Grafana is an open source, feature rich metrics dashboard and graph editor',
276 'URL': 'https://github.com/grafana/grafana',
277 'Vendor': 'Something and Grafana modified',
281 grafana_v2 = _copy(grafana_v1, '1.el7.centos.1', '1.el7.centos.2')