Converted all these files from python 2 to python 3 syntax usong 2to3 library (demo3-microservices.py,demo4-scale-out-add-worker.py,demo4-scale-out.py,demo5-1-durable-storage.py,demo5-2-backup-fractals.py,destroy-all-demo-instances.py)

This commit is contained in:
Usama Tahir
2023-08-07 11:40:03 +05:00
parent 33dfb54db2
commit 9a998ad631
14 changed files with 1510 additions and 26 deletions

View File

@ -111,10 +111,10 @@ def main():
for instance in conn.list_nodes():
if instance.name == 'app-services':
services_ip = instance.private_ips[0]
print('Found app-services fixed IP to be: ', services_ip)
print(('Found app-services fixed IP to be: ', services_ip))
if instance.name == 'app-api-1':
api_1_ip = instance.private_ips[0]
print('Found app-api-1 fixed IP to be: ', api_1_ip)
print(('Found app-api-1 fixed IP to be: ', api_1_ip))
###########################################################################
#
@ -129,7 +129,7 @@ def main():
keypair_exists = True
if keypair_exists:
print('Keypair ' + keypair_name + ' already exists. Skipping import.')
print(('Keypair ' + keypair_name + ' already exists. Skipping import.'))
else:
print('adding keypair...')
conn.import_key_pair_from_file(keypair_name, pub_key_file)
@ -145,10 +145,10 @@ def main():
def get_security_group(connection, security_group_name):
"""A helper function to check if security group already exists"""
print('Checking for existing ' + security_group_name + ' security group...')
print(('Checking for existing ' + security_group_name + ' security group...'))
for security_grp in connection.ex_list_security_groups():
if security_grp.name == security_group_name:
print('Security Group ' + security_group_name + ' already exists. Skipping creation.')
print(('Security Group ' + security_group_name + ' already exists. Skipping creation.'))
return security_grp
return False