Skip to content

Commit eed6fc9

Browse files
authored
Support ops terraform force-unlock (#11)
1 parent 7224ba0 commit eed6fc9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ops/cli/terraform.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,18 @@ def run(self, args):
351351
terraform_path=terraform_path,
352352
vars=vars,
353353
)
354+
elif args.subcommand is not None:
355+
# Examples:
356+
# - command = "state push errored.tfstate"
357+
# - command = "force-unlock <LOCK_ID>"
358+
generate_module_templates = True
359+
cmd = "cd {root_dir}/{terraform_path} && {terraform_init_command} " \
360+
"terraform {command}".format(
361+
command=args.subcommand,
362+
root_dir=self.root_dir,
363+
terraform_init_command=terraform_init_command,
364+
terraform_path=terraform_path,
365+
)
354366
else:
355367
display('Terraform subcommand \'%s\' not found' % args.subcommand, color='red')
356368
return

0 commit comments

Comments
 (0)