Merge ~paride/simplestreams:ubuntu/devel into simplestreams:ubuntu/devel

Proposed by Paride Legovini
Status: Merged
Merged at revision: e9a35905007f7d6f3879ae584824a9a0c29c66bf
Proposed branch: ~paride/simplestreams:ubuntu/devel
Merge into: simplestreams:ubuntu/devel
Diff against target: 632 lines (+196/-51)
24 files modified
.gitignore (+1/-0)
Makefile (+1/-1)
bin/sstream-mirror-glance (+9/-2)
bin/sstream-query (+2/-1)
debian/changelog (+30/-0)
debian/control (+0/-18)
debian/rules (+5/-3)
dev/null (+0/-1)
doc/README (+9/-0)
setup.py (+1/-1)
simplestreams/contentsource.py (+5/-2)
simplestreams/generate_simplestreams.py (+4/-1)
simplestreams/mirrors/__init__.py (+2/-2)
simplestreams/mirrors/glance.py (+9/-2)
simplestreams/objectstores/__init__.py (+2/-2)
simplestreams/objectstores/swift.py (+2/-1)
snap/snapcraft.yaml (+65/-0)
tests/unittests/test_generate_simplestreams.py (+16/-0)
tools/install-deps (+1/-2)
tools/js2signed (+1/-1)
tools/make-test-data (+18/-4)
tools/sign-examples (+1/-1)
tools/ubuntu_versions.py (+3/-3)
tox.ini (+9/-3)
Reviewer Review Type Date Requested Status
Joshua Powers (community) Approve
Scott Moser (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+402896@code.launchpad.net

Description of the change

Cut a new upstream snapshot. This is generated by new-upstream-snapshot plus one manually resolved merge conflict.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

I walked through 'new-upstream-snapshot' and got identical results to Paride, except for the expected name in debian/changelog.

so I ACK this.

review: Approve
Revision history for this message
Joshua Powers (powersj) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index b1af602..623952b 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -9,3 +9,4 @@ exdata-query
6 MANIFEST
7 .coverage
8 .tox
9+*.snap
10diff --git a/Makefile b/Makefile
11index 577e545..3387cc1 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -28,7 +28,7 @@ exdata/fake: exdata-query gnupg
15 $(TENV) ./tools/make-test-data $(EXDATA_SIGN_ARG) exdata-query/ exdata/fake
16
17 exdata-query:
18- rsync -avz --delete --exclude "FILE_DATA_CACHE" --exclude ".bzr/*" cloud-images.ubuntu.com::uec-images/query/ exdata-query
19+ rsync -avz --delete --exclude "FILE_DATA_CACHE" --exclude ".bzr/*" cloud-images.ubuntu.com::cloud-images/query/ exdata-query
20
21 gnupg: gnupg/README
22
23diff --git a/bin/sstream-mirror-glance b/bin/sstream-mirror-glance
24index 5375680..4593a92 100755
25--- a/bin/sstream-mirror-glance
26+++ b/bin/sstream-mirror-glance
27@@ -32,6 +32,7 @@ from simplestreams import util
28 from simplestreams.mirrors import glance
29
30 DEFAULT_FILTERS = ['ftype~(disk1.img|disk.img)', 'arch~(x86_64|amd64|i386)']
31+DEFAULT_KEYRING = "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg"
32
33
34 def error(msg):
35@@ -94,7 +95,7 @@ def main():
36 parser.add_argument('--log-file', default=sys.stderr,
37 type=argparse.FileType('w'))
38
39- parser.add_argument('--keyring', action='store', default=None,
40+ parser.add_argument('--keyring', action='store', default=DEFAULT_KEYRING,
41 help='The keyring for gpg --keyring')
42
43 parser.add_argument('source_mirror')
44@@ -112,6 +113,11 @@ def main():
45 "data. This is useful in OpenStack Clouds which use "
46 "multiple hypervisor types with in a single region.")
47
48+ parser.add_argument('--custom-property', action='append', default=[],
49+ dest="custom_properties",
50+ help='additional properties to add to glance'
51+ ' image metadata (key=value format).')
52+
53 args = parser.parse_args()
54
55 modify_hook = None
56@@ -122,7 +128,8 @@ def main():
57 'cloud_name': args.cloud_name,
58 'modify_hook': modify_hook,
59 'item_filters': args.item_filters,
60- 'hypervisor_mapping': args.hypervisor_mapping}
61+ 'hypervisor_mapping': args.hypervisor_mapping,
62+ 'custom_properties': args.custom_properties}
63
64 (mirror_url, args.path) = util.path_from_mirror_url(args.source_mirror,
65 args.path)
66diff --git a/bin/sstream-query b/bin/sstream-query
67index efe9e0a..6534317 100755
68--- a/bin/sstream-query
69+++ b/bin/sstream-query
70@@ -30,6 +30,7 @@ import sys
71
72 FORMAT_PRETTY = "PRETTY"
73 FORMAT_JSON = "JSON"
74+DEFAULT_KEYRING = "/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg"
75
76
77 def warn(msg):
78@@ -98,7 +99,7 @@ def main():
79 parser.add_argument('--log-file', default=sys.stderr,
80 type=argparse.FileType('w'))
81
82- parser.add_argument('--keyring', action='store', default=None,
83+ parser.add_argument('--keyring', action='store', default=DEFAULT_KEYRING,
84 help='keyring to be specified to gpg via --keyring')
85 parser.add_argument('--no-verify', '-U', action='store_false',
86 dest='verify', default=True,
87diff --git a/debian/changelog b/debian/changelog
88index 41e1af5..56cc537 100644
89--- a/debian/changelog
90+++ b/debian/changelog
91@@ -1,3 +1,33 @@
92+simplestreams (0.1.0-46-gb1f40d99-0ubuntu1) impish; urgency=medium
93+
94+ * New upstream snapshot.
95+ - install-deps: install cargo as a tox dependency [Paride Legovini]
96+ - Add 10s timeout to out-going requests to avoid blocking. [Adam Collard]
97+ - simplestreams: fix use of deprecated LOG.warn method
98+ - Use cloud-images.ubuntu.com rsync module instead of uec-images
99+ [Philip Roche]
100+ - Revert "Skip disk-kvm-img as unsuable under LXD" [Stéphane Graber]
101+ - Make focal the current LTS [Robert C Jennings]
102+ - Drop fast path use of keystoneauth1 sessions object. [James Page]
103+ - Add build-packages to fix build failures on non-amd64 archs. [James Page]
104+ - Add snap packaging for simplestreams [James Page]
105+ - Add support for setting image custom properties [James Page]
106+ - Unpin linting tools to allow them to work on Ubuntu 20.04 LTS.
107+ [James Page]
108+ - make-test-data: Add missing change for uefi1 combined lxd sha
109+ [Robert C Jennings]
110+ - Present LXD KVM with Xenial images [Robert C Jennings]
111+ - Skip disk-kvm-img as unsuable under LXD [Stéphane Graber]
112+ - https://bugs.launchpad.net/simplestreams/+bug/1833435 [Daniele Rondina]
113+ - Fix file matching for disk-kvm.img [Robert C Jennings]
114+ - tools/js2signed: change shebang to /usr/bin/env python3
115+ - Fix file matching for disk-kvm.img [Stéphane Graber]
116+ - Add combined-disk-kvm-img_sha256 to download.json [Stéphane Graber]
117+ - debian: run the tests only against Python 3 [Paride Legovini]
118+ - debian: stop building Python 2 package
119+
120+ -- Paride Legovini <paride@debian.org> Tue, 18 May 2021 12:22:08 +0200
121+
122 simplestreams (0.1.0-25-gba75825b-0ubuntu1) eoan; urgency=medium
123
124 * New upstream snapshot.
125diff --git a/debian/control b/debian/control
126index 350b2d0..d6fc372 100644
127--- a/debian/control
128+++ b/debian/control
129@@ -5,15 +5,6 @@ Standards-Version: 4.2.1
130 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
131 Build-Depends: debhelper (>= 7),
132 dh-python,
133- python-all,
134- python-glanceclient,
135- python-keystoneclient,
136- python-mock,
137- python-nose,
138- python-requests (>= 1.1),
139- python-setuptools,
140- python-swiftclient,
141- python-yaml,
142 python3,
143 python3-flake8,
144 python3-glanceclient,
145@@ -46,15 +37,6 @@ Description: Library and tools for using Simple Streams data
146 This package provides a client for interacting with simple
147 streams data as is produced to describe Ubuntu's cloud images.
148
149-Package: python-simplestreams
150-Architecture: all
151-Priority: optional
152-Depends: gnupg, python-boto, ${misc:Depends}, ${python:Depends}
153-Suggests: python-requests (>= 1.1)
154-Description: Library and tools for using Simple Streams data
155- This package provides a client for interacting with simple
156- streams data as is produced to describe Ubuntu's cloud images.
157-
158 Package: python3-simplestreams-openstack
159 Architecture: all
160 Priority: optional
161diff --git a/debian/python-simplestreams.install b/debian/python-simplestreams.install
162deleted file mode 100644
163index 0236cd1..0000000
164--- a/debian/python-simplestreams.install
165+++ /dev/null
166@@ -1 +0,0 @@
167-usr/lib/python2*/*-packages/simplestreams/*
168diff --git a/debian/rules b/debian/rules
169index bc93943..3e02246 100755
170--- a/debian/rules
171+++ b/debian/rules
172@@ -1,14 +1,16 @@
173 #!/usr/bin/make -f
174
175 export SS_REQUIRE_DISTRO_INFO = 0
176-PYVERS := $(shell pyversions -r)
177 PY3VERS := $(shell py3versions -r)
178 %:
179- dh $@ --with=python2,python3
180+ dh $@ --with=python3
181
182 override_dh_auto_install:
183 dh_auto_install
184- set -ex; for python in $(PY3VERS) $(PYVERS); do \
185+ set -ex; for python in $(PY3VERS); do \
186 $$python setup.py build --executable=/usr/bin/python3 && \
187 $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
188 done
189+
190+override_dh_auto_test:
191+ make test3
192diff --git a/doc/README b/doc/README
193index b484518..6d13222 100644
194--- a/doc/README
195+++ b/doc/README
196@@ -114,6 +114,15 @@ The following is a description of each of these fields:
197 'path' entries for a given item must be immutable. That is, for a
198 given 'path' under a mirror, the content must never change.
199
200+ An 'item' dictionary may contain a 'mirrors' element.
201+
202+ 'mirrors' entries it used for supply a list of mirrors prefix where
203+ retrieve the item. When 'mirrors' is present client must create
204+ the URL of the resource to fetch with the 'path' entry:
205+
206+ item_url = item_mirrors[0] . item_path
207+
208+
209 == Index ==
210 This is a index of products files that are available.
211 It has a top level 'index' dictionary. Each entry in that dictionary is a
212diff --git a/setup.py b/setup.py
213index b4d7d65..6b5a29b 100644
214--- a/setup.py
215+++ b/setup.py
216@@ -1,4 +1,4 @@
217-from distutils.core import setup
218+from setuptools import setup
219 from glob import glob
220 import os
221
222diff --git a/simplestreams/contentsource.py b/simplestreams/contentsource.py
223index 40bf9d0..b54e898 100644
224--- a/simplestreams/contentsource.py
225+++ b/simplestreams/contentsource.py
226@@ -32,6 +32,7 @@ else:
227 urllib_error = urllib_request
228
229 READ_BUFFER_SIZE = 1024 * 10
230+TIMEOUT = 10
231
232 try:
233 # We try to use requests because we can do gzip encoding with it.
234@@ -338,7 +339,7 @@ class Urllib2UrlReader(UrlReader):
235 req.add_header('User-Agent', user_agent)
236 if offset is not None:
237 req.add_header('Range', 'bytes=%d-' % offset)
238- self.req = opener(req)
239+ self.req = opener(req, timeout=TIMEOUT)
240 except urllib_error.HTTPError as e:
241 if e.code == 404:
242 myerr = IOError("Unable to open %s" % url)
243@@ -378,7 +379,9 @@ class RequestsUrlReader(UrlReader):
244 if headers == {}:
245 headers = None
246
247- self.req = requests.get(url, stream=True, auth=auth, headers=headers)
248+ self.req = requests.get(
249+ url, stream=True, auth=auth, headers=headers, timeout=TIMEOUT
250+ )
251 self.r_iter = None
252 if buflen is None:
253 buflen = READ_BUFFER_SIZE
254diff --git a/simplestreams/generate_simplestreams.py b/simplestreams/generate_simplestreams.py
255index a78639b..5cb92b2 100644
256--- a/simplestreams/generate_simplestreams.py
257+++ b/simplestreams/generate_simplestreams.py
258@@ -91,7 +91,10 @@ def write_streams(out_d, trees, updated, namer=None, condense=True):
259 for content_id in trees:
260 if condense:
261 util.products_condense(trees[content_id],
262- sticky=['path', 'sha256', 'md5', 'size'])
263+ sticky=[
264+ 'path', 'sha256', 'md5',
265+ 'size', 'mirrors'
266+ ])
267 content = trees[content_id]
268 to_write.append((index['index'][content_id]['path'], content,))
269 out_filenames = []
270diff --git a/simplestreams/mirrors/__init__.py b/simplestreams/mirrors/__init__.py
271index 60d5ade..4a9593a 100644
272--- a/simplestreams/mirrors/__init__.py
273+++ b/simplestreams/mirrors/__init__.py
274@@ -203,8 +203,8 @@ class UrlMirrorReader(MirrorReader):
275 csource.read(1024)
276 except Exception as e:
277 if isinstance(e, IOError) and (e.errno == errno.ENOENT):
278- LOG.warn("got ENOENT for (%s, %s), trying with trailing /",
279- self.prefix, path)
280+ LOG.warning("got ENOENT for (%s, %s), trying with trailing /",
281+ self.prefix, path)
282 self.prefix = self.prefix + '/'
283 else:
284 # this raised exception, but it was sneaky to do it
285diff --git a/simplestreams/mirrors/glance.py b/simplestreams/mirrors/glance.py
286index bdec7c8..cd26c06 100644
287--- a/simplestreams/mirrors/glance.py
288+++ b/simplestreams/mirrors/glance.py
289@@ -23,6 +23,7 @@ import simplestreams.openstack as openstack
290 from simplestreams.log import LOG
291
292 import copy
293+import collections
294 import errno
295 import glanceclient
296 import json
297@@ -168,6 +169,10 @@ class GlanceMirror(mirrors.BasicMirrorWriter):
298 if not self.content_id:
299 raise TypeError("content_id is required")
300
301+ self.custom_properties = collections.OrderedDict(
302+ prop.split('=') for prop in config.get("custom_properties", [])
303+ )
304+
305 def _cidpath(self, content_id):
306 return "streams/v1/%s.json" % content_id
307
308@@ -210,7 +215,7 @@ class GlanceMirror(mirrors.BasicMirrorWriter):
309 continue
310
311 if image.get('status') != "active":
312- LOG.warn("Ignoring inactive image %s with status '%s'" % (
313+ LOG.warning("Ignoring inactive image %s with status '%s'" % (
314 image['id'], image.get('status')))
315 continue
316
317@@ -220,7 +225,7 @@ class GlanceMirror(mirrors.BasicMirrorWriter):
318 version = props.get('version_name')
319 item = props.get('item_name')
320 if not (version and product and item and source_content_id):
321- LOG.warn("%s missing required fields" % image['id'])
322+ LOG.warning("%s missing required fields" % image['id'])
323 continue
324
325 # get data from the datastore for this item, if it exists
326@@ -291,6 +296,8 @@ class GlanceMirror(mirrors.BasicMirrorWriter):
327 if _hypervisor_type:
328 properties['hypervisor_type'] = _hypervisor_type
329
330+ properties.update(self.custom_properties)
331+
332 # Store flattened metadata for a source image along with the
333 # image in 'simplestreams_metadata' property.
334 simplestreams_metadata = image_metadata.copy()
335diff --git a/simplestreams/objectstores/__init__.py b/simplestreams/objectstores/__init__.py
336index 6ce8ff0..f118a92 100644
337--- a/simplestreams/objectstores/__init__.py
338+++ b/simplestreams/objectstores/__init__.py
339@@ -175,13 +175,13 @@ class FileStore(ObjectStore):
340 if not reader.check():
341 os.unlink(partfile)
342 if orig_part_size:
343- LOG.warn(resume_msg)
344+ LOG.warning(resume_msg)
345 raise checksum_util.invalid_checksum_for_reader(reader)
346 else:
347 if not cksum.check():
348 os.unlink(partfile)
349 if orig_part_size:
350- LOG.warn(resume_msg)
351+ LOG.warning(resume_msg)
352 raise checksum_util.InvalidChecksum(path=path, cksum=cksum)
353 os.rename(partfile, wpath)
354
355diff --git a/simplestreams/objectstores/swift.py b/simplestreams/objectstores/swift.py
356index 9a6eb62..f2c0d5b 100644
357--- a/simplestreams/objectstores/swift.py
358+++ b/simplestreams/objectstores/swift.py
359@@ -37,7 +37,8 @@ def get_swiftclient(**kwargs):
360 sess = kwargs.get('session')
361 try:
362 # If session is available try it
363- return Connection(session=sess)
364+ return Connection(session=sess,
365+ cacert=kwargs.get('cacert'))
366 except TypeError:
367 # The edge case where session is availble but swiftclient is
368 # < 3.3.0. Use the old style method for Connection.
369diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
370new file mode 100644
371index 0000000..75ac11a
372--- /dev/null
373+++ b/snap/snapcraft.yaml
374@@ -0,0 +1,65 @@
375+name: simplestreams
376+base: core18
377+adopt-info: simplestreams
378+summary: Library and tools for using Simple Streams data
379+description: Library and tools for using Simple Streams data
380+
381+grade: stable
382+confinement: strict
383+
384+layout:
385+ /usr/share/keyrings:
386+ bind: $SNAP/usr/share/keyrings
387+
388+apps:
389+ sstream-mirror:
390+ command: bin/sstream-mirror
391+ plugs:
392+ - network
393+ - home
394+ sstream-mirror-glance:
395+ command: bin/sstream-mirror-glance
396+ plugs:
397+ - network
398+ - home
399+ sstream-query:
400+ command: bin/sstream-query
401+ plugs:
402+ - network
403+ - home
404+ sstream-sync:
405+ command: bin/sstream-sync
406+ plugs:
407+ - network
408+ - home
409+ json2streams:
410+ command: bin/json2streams
411+ plugs:
412+ - network
413+ - home
414+
415+parts:
416+ simplestreams:
417+ plugin: python
418+ python-version: python3
419+ source: .
420+ source-type: git
421+ constraints:
422+ - https://raw.githubusercontent.com/openstack/requirements/stable/ussuri/upper-constraints.txt
423+ python-packages:
424+ - python-glanceclient
425+ - python-keystoneclient
426+ - python-swiftclient
427+ stage-packages:
428+ - gpgv
429+ - ubuntu-keyring
430+ build-packages:
431+ - libffi-dev
432+ - libssl-dev
433+ - libxml2-dev
434+ - libxslt1-dev
435+ override-build: |
436+ snapcraftctl build
437+ last_release="$(git tag -l --sort=version:refname | grep -v ubuntu | tail -1)"
438+ current_shorthash="$(git log --format="%h" | head -1)"
439+ snapcraftctl set-version "${last_release}-${current_shorthash}"
440diff --git a/tests/unittests/test_generate_simplestreams.py b/tests/unittests/test_generate_simplestreams.py
441index 61b078d..a47a126 100644
442--- a/tests/unittests/test_generate_simplestreams.py
443+++ b/tests/unittests/test_generate_simplestreams.py
444@@ -264,3 +264,19 @@ class TestWriteStreams(TestCase):
445 'item-1': {'arch': 'amd64'},
446 'item-2': {'arch': 'amd64'}, }}}}}}
447 self.assertEqual(bar, expected)
448+
449+ def test_mirrors(self):
450+ trees = {
451+ 'bar': {'products': {'prodbar': {'versions': {'1': {'items': {
452+ 'item-1': {'arch': 'amd64', 'mirrors': ['url1', 'url2']},
453+ 'item-2': {'arch': 'amd64'}}}}}}}}
454+ with temp_dir() as out_dir, patch('sys.stderr', StringIO()):
455+ write_streams(out_dir, trees, self.updated, FakeNamer,
456+ condense=False)
457+ with open(os.path.join(out_dir, 'bar.json')) as bar_file:
458+ bar = json.load(bar_file)
459+ expected = {
460+ 'products': {'prodbar': {'versions': {'1': {'items': {
461+ 'item-1': {'arch': 'amd64', 'mirrors': ['url1', 'url2']},
462+ 'item-2': {'arch': 'amd64'}, }}}}}}
463+ self.assertEqual(bar, expected)
464diff --git a/tools/install-deps b/tools/install-deps
465index 870da30..34888c5 100755
466--- a/tools/install-deps
467+++ b/tools/install-deps
468@@ -107,8 +107,7 @@ elif [ "$1" = "tox" ]; then
469 deps="gnupg tox"
470 # these come as needed to build python-netaddr which is
471 # a pip dependency of some of the openstack packages.
472- deps="$deps python-dev python3-dev build-essential"
473- deps="$deps python-dev python3-dev build-essential"
474+ deps="$deps python-dev python3-dev build-essential cargo"
475 arch=$(dpkg --print-architecture)
476 case "$arch" in
477 i386|amd64) :;;
478diff --git a/tools/js2signed b/tools/js2signed
479index b02054b..2b66e5f 100755
480--- a/tools/js2signed
481+++ b/tools/js2signed
482@@ -1,4 +1,4 @@
483-#!/usr/bin/env python
484+#!/usr/bin/env python3
485 # Copyright (C) 2013 Canonical Ltd.
486 #
487 # Author: Scott Moser <scott.moser@canonical.com>
488diff --git a/tools/make-test-data b/tools/make-test-data
489index a1e183d..a287dab 100755
490--- a/tools/make-test-data
491+++ b/tools/make-test-data
492@@ -32,7 +32,7 @@ try:
493 url_request = urllib.request.Request
494 url_open = urllib.request.urlopen
495 url_error = urllib.error
496-except ImportError as e:
497+except ImportError:
498 import urllib2
499 url_request = urllib2.Request
500 url_open = urllib2.urlopen
501@@ -53,7 +53,13 @@ BASE_URLS = (
502
503 FAKE_DATA = {
504 'root.tar.gz': {'size': 10240},
505- 'root.tar.xz': {'size': 10241},
506+ 'root.tar.xz': {
507+ 'size': 10241,
508+ 'mirrors': [
509+ 'https://us.images.linuxcontainers.org/',
510+ 'https://uk.images.linuxcontainers.org/'
511+ ]
512+ },
513 'root.manifest': {'size': 10242},
514 'lxd.tar.xz': {'size': 10245},
515 'tar.gz': {'size': 11264},
516@@ -197,7 +203,7 @@ def load_data_in_dir(path):
517 except ValueError as e:
518 sys.stderr.write("qindex parse failed %s" % path)
519 raise e
520- except NonExistingUrl as e:
521+ except NonExistingUrl:
522 # sys.stderr.write("%s: 404 (%s)" % (qpath, e))
523 pass
524
525@@ -265,7 +271,7 @@ def get_cloud_images_file_size(path, save=True):
526 try:
527 size = int(get_url_len(burl + path))
528 break
529- except Exception as error:
530+ except Exception:
531 sys.stderr.write(" size stat failed: %s" % burl + path)
532 pass
533
534@@ -298,8 +304,12 @@ def create_fake_file(prefix, item):
535 # - combined_sha256 and combined_rootxz_sha256 for the -root.tar.gz
536 # - combined_squashfs_sha256 for the squashfs
537 # - combined_disk1-img_sha256 for the img
538+ # - combined_uefi1-img_sha256 for the img (xenial)
539+ # - combined_disk-kvm-img_sha256 for the img
540 ftype = item['ftype']
541 for name, extension in (('disk1-img', '.img'),
542+ ('uefi1-img', '-uefi1.img'), # xenial
543+ ('disk-kvm-img', '-disk-kvm.img'),
544 ('rootxz', '-root.tar.xz'),
545 ('squashfs', '.squashfs')):
546 if (ftype == "lxd.tar.xz" and
547@@ -309,6 +319,8 @@ def create_fake_file(prefix, item):
548 rootitem = item.copy()
549 rootitem['ftype'] = extension.lstrip('-.')
550 rootitem['path'] = rootpath
551+ if 'mirrors' in FAKE_DATA[ftype]:
552+ rootitem['mirrors'] = FAKE_DATA[ftype]['mirrors']
553 create_fake_file(prefix, rootitem)
554
555 # and sha256 hash the combined file
556@@ -570,6 +582,8 @@ def create_image_data(query_tree, out_d, streamdir):
557
558 # find calculated combined checksums
559 for name, extension in (('disk1-img', '.img'),
560+ ('uefi1-img', '-uefi1.img'), # xenial
561+ ('disk-kvm-img', '-disk-kvm.img'),
562 ('rootxz', '-root.tar.xz'),
563 ('squashfs', '.squashfs')):
564 root = lxd.replace('-lxd.tar.xz', extension)
565diff --git a/tools/sign-examples b/tools/sign-examples
566index 9b549d2..89d5dd8 100755
567--- a/tools/sign-examples
568+++ b/tools/sign-examples
569@@ -6,4 +6,4 @@ FILES=( ${TOP_DIR}/examples/*/streams/v1/*.json )
570 force=""
571 [ "$1" = "--force" ] && force="$1"
572
573-"${TOP_DIR}/tools/js2signed" $force "${FILES[@]}"
574+$SS_PYTHON "${TOP_DIR}/tools/js2signed" $force "${FILES[@]}"
575diff --git a/tools/ubuntu_versions.py b/tools/ubuntu_versions.py
576index aeecd47..4b896c6 100644
577--- a/tools/ubuntu_versions.py
578+++ b/tools/ubuntu_versions.py
579@@ -23,7 +23,7 @@ from simplestreams.log import LOG
580
581 # Needs to be changed whenever do-release-upgrade is flipped to the next
582 # LTS (typically around the time of .1)
583-CURRENT_LTS = "bionic"
584+CURRENT_LTS = "focal"
585
586 # This data is only used if python-distro-info is not available and
587 # the user has set environment variable SS_REQUIRE_DISTRO_INFO=0
588@@ -99,8 +99,8 @@ def get_ubuntu_info(date=None):
589 try:
590 devel = udi.devel(date=date)
591 except distro_info.DistroDataOutdated as e:
592- LOG.warn("distro_info.UbuntuDistroInfo() raised exception (%s)."
593- " Using stable release as devel.", e)
594+ LOG.warning("distro_info.UbuntuDistroInfo() raised exception (%s)."
595+ " Using stable release as devel.", e)
596 devel = udi.stable(date=date)
597 ret = []
598
599diff --git a/tox.ini b/tox.ini
600index 654652e..b450afc 100644
601--- a/tox.ini
602+++ b/tox.ini
603@@ -4,6 +4,7 @@ envlist = py27, py3, flake8
604 [testenv]
605 setenv =
606 GNUPGHOME={toxinidir}/gnupg
607+ SS_PYTHON={envpython}
608 commands =
609 {toxinidir}/tools/create-gpgdir
610 {toxinidir}/tools/sign-examples
611@@ -19,9 +20,9 @@ deps =
612
613 [testenv:flake8]
614 basepython = python3
615-deps = flake8==3.5.0
616- pycodestyle==2.3.1
617- pyflakes==1.6.0
618+deps = flake8>=3.5.0
619+ pycodestyle>=2.3.1
620+ pyflakes>=1.6.0
621 commands = {toxinidir}/tools/run-flake8 {posargs}
622
623 [testenv:py3-noopenstack]
624@@ -30,3 +31,8 @@ deps =
625 mock
626 nose
627 basepython = python3
628+
629+[testenv:snap]
630+deps =
631+whitelist_externals = /snap/bin/snapcraft
632+commands = snapcraft --use-lxd

Subscribers

People subscribed via source and target branches