as far as I can tell, this works except that I am getting errors because of python 2.7 and printing

This commit is contained in:
cktricky
2018-04-05 14:18:08 -10:00
parent 61e470df94
commit 86654a6fb1
3 changed files with 17 additions and 3 deletions

View File

@@ -1 +1,11 @@
import os
list_of_files = os.listdir('.')
arry = []
for file in list_of_files:
filename_and_ext = os.path.splitext(file)
if filename_and_ext[1] == ".py":
arry.append(filename_and_ext[0])
__all__ = arry

View File

@@ -21,6 +21,9 @@ def get_accountid(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
# print username
# return username
def step_app():
print('hiiiiiii')
def check_root_account(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
client = boto3.client('iam', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)

View File

@@ -11,6 +11,7 @@ import argparse
import os
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
from botocore.exceptions import ClientError
from libs import *
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--step", help="list the step you would like to run",
@@ -35,9 +36,9 @@ def step_recon():
def method_create():
try:
arg = eval("step_" + args.step)
arg = globals()["step_" + args.step]#arg = eval("step_" + args.step)
return arg
except NameError:
except KeyError:
print("That step does not exist")
exit(1)