Skip to content

Commit

Permalink
Merge pull request #54 from tilezen/dees/py3-compat
Browse files Browse the repository at this point in the history
Fixes to allow python3 compatibility on cron.py
  • Loading branch information
iandees authored Jul 10, 2019
2 parents e12d046 + 81dff7d commit 1a08d97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions batch-setup/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def generate_password(length):

chars = string.ascii_letters + string.digits
password = ''
for i in xrange(0, length):
for i in range(0, length):
# get two bytes of random and turn into an integer. given the small
# size of the chars alphabet (=62 values), two bytes (=65,536 values)
# should be enough to avoid too big a bias towards the lower range of
Expand Down Expand Up @@ -529,7 +529,7 @@ def is_power_of_two(x):
region = args.region or os.environ.get('AWS_DEFAULT_REGION')
if region is None:
import sys
print "ERROR: Need environment variable AWS_DEFAULT_REGION to be set."
print("ERROR: Need environment variable AWS_DEFAULT_REGION to be set.")
sys.exit(1)

# checking that metatile size has a valid value, and it's in a sensible
Expand Down Expand Up @@ -620,7 +620,7 @@ def bucket_name(arg_name, bucket_function):
script_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(script_dir, 'provision.sh'), 'r') as fh:
provision = fh.read() % provision_params
provision_base64 = b64encode(provision)
provision_base64 = b64encode(provision.encode('utf8'))

ec2 = boto3.client('ec2')

Expand Down

0 comments on commit 1a08d97

Please sign in to comment.