lightsaile pep8
This commit is contained in:
@@ -40,8 +40,8 @@ def lightsail_get_instances():
|
|||||||
print('{} : (AuthFailure) when calling the Get Instances -- key is invalid or no permissions.' .format(AWS_ACCESS_KEY_ID))
|
print('{} : (AuthFailure) when calling the Get Instances -- key is invalid or no permissions.' .format(AWS_ACCESS_KEY_ID))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
elif e.response['Error']['Code'] == 'AccessDeniedException':
|
elif e.response['Error']['Code'] == 'AccessDeniedException':
|
||||||
print('{} : (AccessDeniedException) no permissions.' .format(AWS_ACCESS_KEY_ID))
|
print('{} : (AccessDeniedException) no permissions.' .format(AWS_ACCESS_KEY_ID))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print(e)
|
print(e)
|
||||||
@@ -49,10 +49,10 @@ def lightsail_get_instances():
|
|||||||
print("[-] get_instances allowed for {} but no results [-]" .format(region))
|
print("[-] get_instances allowed for {} but no results [-]" .format(region))
|
||||||
else:
|
else:
|
||||||
print("[+] Listing instances for region: {} [+]" .format(region))
|
print("[+] Listing instances for region: {} [+]" .format(region))
|
||||||
#db_logger = []
|
# db_logger = []
|
||||||
for r in response['instances']:
|
for r in response['instances']:
|
||||||
# db_logger.append(['ec2', 'DescribeInstances', str(r), AWS_ACCESS_KEY_ID, target, datetime.datetime.now()])
|
# db_logger.append(['ec2', 'DescribeInstances', str(r), AWS_ACCESS_KEY_ID, target, datetime.datetime.now()])
|
||||||
#for i in r['Instances']:
|
# for i in r['Instances']:
|
||||||
pp.pprint(r)
|
pp.pprint(r)
|
||||||
# logging to db here
|
# logging to db here
|
||||||
# try:
|
# try:
|
||||||
@@ -70,4 +70,4 @@ def lightsail_get_instances():
|
|||||||
else:
|
else:
|
||||||
print(e)
|
print(e)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("CTRL-C received, exiting...")
|
print("CTRL-C received, exiting...")
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ def module_lightsail_get_instances():
|
|||||||
Lightsail get_instances
|
Lightsail get_instances
|
||||||
python3 weirdAAL.py -m lightsail_get_instances -t demo
|
python3 weirdAAL.py -m lightsail_get_instances -t demo
|
||||||
'''
|
'''
|
||||||
lightsail_get_instances()
|
lightsail_get_instances()
|
||||||
|
|||||||
Reference in New Issue
Block a user