Skip to content

Commit

Permalink
CYBL-1834-Fix-Passing-Varaibles-TFSec (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadiesa-abu authored Oct 3, 2022
1 parent 0d7e0e7 commit e47d3fe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.19.8:
- Pass the variables file to tfsec correctly.
0.19.7:
- Bump SDK to fix an issue with get_environment_capability.
0.19.6:
Expand Down
5 changes: 4 additions & 1 deletion cloudify_tf/terraform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ def check_tfsec(self):
self.tfsec.terraform_root_module = self.root_module
commands = []
with self.runtime_file(commands):
self.tfsec.tfsec()
# injecting another - to make the flag correct
if commands:
commands[0] = "-{0}".format(commands[0])
self.tfsec.tfsec(commands)

def run_terratag(self):
if not self.terratag:
Expand Down
5 changes: 4 additions & 1 deletion cloudify_tf/terraform/tfsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,16 @@ def configfile(self):
except Exception:
raise

def tfsec(self):
def tfsec(self, command_extension=None):
with self.configfile() as config_file:
basic_commands = ['.', '--no-color', '--format', 'json']

if config_file:
basic_commands.extend(['--config-file', config_file])

if command_extension:
basic_commands.extend(command_extension)

command = self.merged_args(self.flags, basic_commands)
command.insert(0, self.executable_path)
return self.execute(command, self.terraform_root_module, self.env,
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.19.7'
package_version: '0.19.8'

dsl_definitions:

Expand Down
2 changes: 1 addition & 1 deletion plugin_1_4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.19.7'
package_version: '0.19.8'

dsl_definitions:

Expand Down
2 changes: 1 addition & 1 deletion v2_plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.19.7'
package_version: '0.19.8'

dsl_definitions:

Expand Down

0 comments on commit e47d3fe

Please sign in to comment.