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
diff --git a/jobs/generic-release-snap b/jobs/generic-release-snap
index 7140be5..45d7507 100755
--- a/jobs/generic-release-snap
+++ b/jobs/generic-release-snap
@@ -58,6 +58,4 @@ git push origin stable
58git push origin master58git push origin master
59git push origin $VERSION59git push origin $VERSION
6060
61
62
63exec $WORKSPACE/build-scripts/scripts/trigger-lp-build.py -s $SNAP_NAME -p61exec $WORKSPACE/build-scripts/scripts/trigger-lp-build.py -s $SNAP_NAME -p
diff --git a/scripts/trigger-lp-build.py b/scripts/trigger-lp-build.py
index ed3d3e8..2de16e3 100755
--- a/scripts/trigger-lp-build.py
+++ b/scripts/trigger-lp-build.py
@@ -33,7 +33,7 @@ ephemeral_build=False
3333
34if args['new']:34if args['new']:
35 ephemeral_build=True35 ephemeral_build=True
36 if not 'git_repo' in args or not 'git_repo_branch' in args:36 if args['git_repo'] == None or args['git_repo_branch'] == None:
37 print("ERROR: No git repository or a branch supplied")37 print("ERROR: No git repository or a branch supplied")
38 sys.exit(1)38 sys.exit(1)
3939
@@ -52,7 +52,7 @@ primary_archive = ubuntu.getArchive(name='primary')
52snap=None52snap=None
53if ephemeral_build:53if ephemeral_build:
54 snap_arches=[]54 snap_arches=[]
55 if 'architectures' in args and len(args['architectures']) > 0:55 if 'architectures' in args and args['architectures'] != None:
56 snap_arches = args["architectures"].split(",")56 snap_arches = args["architectures"].split(",")
5757
58 if len(snap_arches) == 0:58 if len(snap_arches) == 0:
@@ -86,7 +86,7 @@ if snap == None:
8686
87# Not every snap is build agains all arches.87# Not every snap is build agains all arches.
88arches = [processor.name for processor in snap.processors]88arches = [processor.name for processor in snap.processors]
89if not ephemeral_build and "architectures" in args:89if not ephemeral_build and args['architectures'] != None:
90 wanted_arches = args["architectures"].split(",")90 wanted_arches = args["architectures"].split(",")
91 possible_arches = []91 possible_arches = []
92 for arch in wanted_arches:92 for arch in wanted_arches:

Subscribers

People subscribed via source and target branches

to all changes: