Skip to content

Commit

Permalink
Update nextbuildver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PeckTonium authored Aug 23, 2017
1 parent 789411c commit df3704e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions engagement/email/nextbuildver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import sys

import boto3
import botocore
import semver

parser = argparse.ArgumentParser(description='Find next version number')
Expand All @@ -48,11 +49,14 @@

###### Check parameter values

s3 = boto3.resource('s3')
buckets = [bucket.name for bucket in list(s3.buckets.all())]
if args.bucket_name not in buckets:
s3_client = boto3.client('s3')
try:
s3_client.head_bucket(Bucket=args.bucket_name)
except botocore.exceptions.ClientError as clerr:
print "Error: \"bucket_name\" has an invalid value (%s)" % args.bucket_name
exit(1)

s3 = boto3.resource('s3')

ext_index = args.artifact_name.rfind(".")
if ext_index != -1:
Expand Down

0 comments on commit df3704e

Please sign in to comment.