Merge lp:~joetalbott/snappy-proposed-image-builder/use_tmpdir into lp:snappy-proposed-image-builder

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 16
Merged at revision: 13
Proposed branch: lp:~joetalbott/snappy-proposed-image-builder/use_tmpdir
Merge into: lp:snappy-proposed-image-builder
Diff against target: 66 lines (+10/-5)
1 file modified
snappy_proposed_image_builder/worker.py (+10/-5)
To merge this branch: bzr merge lp:~joetalbott/snappy-proposed-image-builder/use_tmpdir
Reviewer Review Type Date Requested Status
Joe Talbott (community) Approve
Francis Ginther Approve
Celso Providelo (community) Approve
Review via email: mp+261288@code.launchpad.net

Commit message

Fix tmpdir usage.

Description of the change

Fix tmpdir usage.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) :
review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

Just a nit-pick, feel free to merge.

review: Approve
Revision history for this message
Joe Talbott (joetalbott) :
review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (24.3 KiB)

The attempt to merge lp:~joetalbott/snappy-proposed-image-builder/use_tmpdir into lp:snappy-proposed-image-builder failed. Below is the output from the failed tests.

Using base prefix '/usr'
New python executable in /tmp/venv-snappy-proposed-image-builderbxn26k3q/bin/python3
Also creating executable in /tmp/venv-snappy-proposed-image-builderbxn26k3q/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python3
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking idna (from -r requirements.txt (line 5))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/idna/setup.py) egg_info for package idna

    warning: no previously-included files matching '*.pyc' found under directory 'tools'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
Downloading/unpacking cffi (from -r requirements.txt (line 6))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/cffi/setup.py) egg_info for package cffi

Downloading/unpacking pyasn1 (from -r requirements.txt (line 7))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/pyasn1/setup.py) egg_info for package pyasn1

Downloading/unpacking kombu==3.0.24 (from -r requirements.txt (line 8))
Downloading/unpacking python-logstash==0.4.2 (from -r requirements.txt (line 9))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/python-logstash/setup.py) egg_info for package python-logstash

Downloading/unpacking python-glanceclient==0.17.0 (from -r requirements.txt (line 10))
Downloading/unpacking uservice-utils==1.0.3 (from -r requirements.txt (line 11))
Downloading/unpacking traceback2==1.4.0 (from -r requirements.txt (line 12))
Downloading/unpacking pycparser (from cffi->-r requirements.txt (line 6))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/pycparser/setup.py) egg_info for package pycparser

    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
Downloading/unpacking anyjson>=0.3.3 (from kombu==3.0.24->-r requirements.txt (line 8))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/anyjson/setup.py) egg_info for package anyjson

Downloading/unpacking amqp>=1.4.5,<2.0 (from kombu==3.0.24->-r requirements.txt (line 8))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3q/build/amqp/setup.py) egg_info for package amqp

Downloading/unpacking pbr>=0.6,!=0.7,<1.0 (from python-glanceclient==0.17.0->-r requirements.txt (line 10))
Downloading/unpacking argparse (from python-glanceclient==0.17.0->-r requirements.txt (line 10))
Downloading/unpacking PrettyTable>=0.7,<0.8 (from python-glanceclient==0.17.0->-r requirements.txt (line 10))
  Running setup.py (path:/tmp/venv-snappy-proposed-image-builderbxn26k3...

16. By Joe Talbott

Fix flake8 warnings.

Revision history for this message
Joe Talbott (joetalbott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy_proposed_image_builder/worker.py'
2--- snappy_proposed_image_builder/worker.py 2015-06-02 17:16:50 +0000
3+++ snappy_proposed_image_builder/worker.py 2015-06-05 21:22:58 +0000
4@@ -37,6 +37,10 @@
5 logger = logging.getLogger(__name__)
6
7
8+ubuntu_device_flash = os.path.join(os.path.dirname(os.path.abspath(__file__)),
9+ '..', 'ubuntu-device-flash')
10+
11+
12 class RootFSError(Exception):
13 pass
14
15@@ -109,6 +113,7 @@
16 try:
17 rootfs_path = download_rootfs(
18 image_version,
19+ release,
20 channel,
21 device,
22 tmpdir
23@@ -187,7 +192,7 @@
24 image_path = os.path.join(tmpdir, 'snappy-proposed-{}.img'.format(name))
25
26 cmd = ['sudo',
27- './ubuntu-device-flash',
28+ ubuntu_device_flash,
29 '--revision', name,
30 '--download-only',
31 'core',
32@@ -198,14 +203,14 @@
33 '--developer-mode',
34 '--cloud',
35 release]
36- check_call(cmd)
37+ check_call(cmd, cwd=tmpdir)
38
39 cmd = ['sudo',
40 'rm',
41 '-rf',
42 os.path.join(tmpdir, '.gnupg')]
43 check_call(cmd)
44- output = glob.glob('ubuntu-*.tar.xz')
45+ output = glob.glob(os.path.join(tmpdir, 'ubuntu-*.tar.xz'))
46 return output[0]
47
48
49@@ -363,7 +368,7 @@
50 """Download the ubuntu code image, return a path to it on disk."""
51 image_path = os.path.join(tmpdir, 'snappy-proposed-{}.img'.format(name))
52 cmd = ['sudo',
53- './ubuntu-device-flash',
54+ ubuntu_device_flash,
55 '--revision', name,
56 'core',
57 '--device', device,
58@@ -422,7 +427,7 @@
59 """Obtains a bytestring of the images info from the core image server"""
60 extra = LOGGING_EXTRA.copy()
61 cmd = [
62- './ubuntu-device-flash',
63+ ubuntu_device_flash,
64 'query',
65 '--show-image',
66 '--channel=ubuntu-core/{}/{}'.format(release, channel),

Subscribers

People subscribed via source and target branches