Merge ~morphis/snappy-hwe-snaps/+git/build-scripts:b/check-arguments-correctly into ~snappy-hwe-team/snappy-hwe-snaps/+git/build-scripts:master

Proposed by Simon Fels
Status: Merged
Approved by: Jim Hodapp
Approved revision: 92b9990e7fbc967aa304337465057872837f4fe7
Merged at revision: 1936cf5fce2284a54d44aac7123098d0ecddc6de
Proposed branch: ~morphis/snappy-hwe-snaps/+git/build-scripts:b/check-arguments-correctly
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/build-scripts:master
Diff against target: 42 lines (+3/-5)
2 files modified
jobs/generic-release-snap (+0/-2)
scripts/trigger-lp-build.py (+3/-3)
Reviewer Review Type Date Requested Status
Jim Hodapp (community) Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+318600@code.launchpad.net

Description of the change

Correct argument handling to properly check for available arguments.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jobs/generic-release-snap b/jobs/generic-release-snap
2index 7140be5..45d7507 100755
3--- a/jobs/generic-release-snap
4+++ b/jobs/generic-release-snap
5@@ -58,6 +58,4 @@ git push origin stable
6 git push origin master
7 git push origin $VERSION
8
9-
10-
11 exec $WORKSPACE/build-scripts/scripts/trigger-lp-build.py -s $SNAP_NAME -p
12diff --git a/scripts/trigger-lp-build.py b/scripts/trigger-lp-build.py
13index ed3d3e8..2de16e3 100755
14--- a/scripts/trigger-lp-build.py
15+++ b/scripts/trigger-lp-build.py
16@@ -33,7 +33,7 @@ ephemeral_build=False
17
18 if args['new']:
19 ephemeral_build=True
20- if not 'git_repo' in args or not 'git_repo_branch' in args:
21+ if args['git_repo'] == None or args['git_repo_branch'] == None:
22 print("ERROR: No git repository or a branch supplied")
23 sys.exit(1)
24
25@@ -52,7 +52,7 @@ primary_archive = ubuntu.getArchive(name='primary')
26 snap=None
27 if ephemeral_build:
28 snap_arches=[]
29- if 'architectures' in args and len(args['architectures']) > 0:
30+ if 'architectures' in args and args['architectures'] != None:
31 snap_arches = args["architectures"].split(",")
32
33 if len(snap_arches) == 0:
34@@ -86,7 +86,7 @@ if snap == None:
35
36 # Not every snap is build agains all arches.
37 arches = [processor.name for processor in snap.processors]
38-if not ephemeral_build and "architectures" in args:
39+if not ephemeral_build and args['architectures'] != None:
40 wanted_arches = args["architectures"].split(",")
41 possible_arches = []
42 for arch in wanted_arches:

Subscribers

People subscribed via source and target branches

to all changes: