~cjwatson/launchpad-buildd/snap-git-proxy

« back to all changes in this revision

Viewing changes to lpbuildd/snap.py

  • Committer: Colin Watson
  • Date: 2017-05-11 11:45:22 UTC
  • mfrom: (215.2.3 launchpad-buildd)
  • Revision ID: cjwatson@canonical.com-20170511114522-rqz27aj8m1zi4vo5
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright 2015-2016 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
 
4
from __future__ import print_function
 
5
 
4
6
__metaclass__ = type
5
7
 
 
8
import json
6
9
import os
7
10
import shutil
 
11
import sys
8
12
 
9
13
from lpbuildd.debian import (
10
14
    DebianBuildManager,
51
55
 
52
56
        super(SnapBuildManager, self).initiate(files, chroot, extra_args)
53
57
 
 
58
    def status(self):
 
59
        status_path = get_build_path(self.home, self._buildid, "status")
 
60
        try:
 
61
            with open(status_path) as status_file:
 
62
                return json.load(status_file)
 
63
        except IOError:
 
64
            pass
 
65
        except Exception as e:
 
66
            print(
 
67
                "Error deserialising status from buildsnap: %s" % e,
 
68
                file=sys.stderr)
 
69
        return {}
 
70
 
54
71
    def doRunBuild(self):
55
72
        """Run the process to build the snap."""
56
73
        args = [