Changed -p flag to be -n for neutralize for stoppping atmos from doing var appending
This commit is contained in:
parent
dc5ba48990
commit
8bff7443d5
1 changed files with 2 additions and 2 deletions
4
atmos.py
4
atmos.py
|
|
@ -8,7 +8,7 @@ def main(argv):
|
||||||
g.add_argument("command", help="Send commands to terraform with workspace variable context", nargs='?', default=False)
|
g.add_argument("command", help="Send commands to terraform with workspace variable context", nargs='?', default=False)
|
||||||
parser.add_argument("-e", help="Gather shared-creds from environment variables (Dont use this flag if you dont want your ~/.aws/credentials replaced. This is for CI/CD", action='store_true', default=False)
|
parser.add_argument("-e", help="Gather shared-creds from environment variables (Dont use this flag if you dont want your ~/.aws/credentials replaced. This is for CI/CD", action='store_true', default=False)
|
||||||
parser.add_argument("-m", help="Prevents workspace from changing with git branches automatically", action='store_true', default=False)
|
parser.add_argument("-m", help="Prevents workspace from changing with git branches automatically", action='store_true', default=False)
|
||||||
parser.add_argument("-p", help="Atmos will not add -var-file or -var args to terraform", action='store_true', default=False)
|
parser.add_argument("-n", help="Atmos will not add -var-file or -var args to terraform", action='store_true', default=False)
|
||||||
args, params = parser.parse_known_args()
|
args, params = parser.parse_known_args()
|
||||||
if args.command:
|
if args.command:
|
||||||
determine_actions(args, params)
|
determine_actions(args, params)
|
||||||
|
|
@ -23,7 +23,7 @@ def determine_actions(args, params):
|
||||||
env_actions = ["plan", "apply", "destroy"] # Commands that require env context
|
env_actions = ["plan", "apply", "destroy"] # Commands that require env context
|
||||||
cmd = 'terraform {args}'.format(args=args.command)
|
cmd = 'terraform {args}'.format(args=args.command)
|
||||||
|
|
||||||
if (args.command in env_actions) and not (args.p): # Append with env context
|
if (args.command in env_actions) and not (args.n): # Append with env context
|
||||||
cmd = cmd + ' -var-file=vars/{env}.tfvars -var "workspace={env}" -var "shared_credentials_file={aws_creds_file}"'.format(env=workspace, aws_creds_file=aws_creds_file)
|
cmd = cmd + ' -var-file=vars/{env}.tfvars -var "workspace={env}" -var "shared_credentials_file={aws_creds_file}"'.format(env=workspace, aws_creds_file=aws_creds_file)
|
||||||
|
|
||||||
for param in params: # Pass terraform params directly through
|
for param in params: # Pass terraform params directly through
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue