Skip to content

Commit

Permalink
Enforce JSON parsing for Terraform aggregate types 'list' and 'map'.
Browse files Browse the repository at this point in the history
  • Loading branch information
metmajer committed Oct 23, 2018
1 parent 5d65779 commit ce5bac8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pre_commit_hooks/terraform_inputs_jenkins_pipeline_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,8 @@ def transform_terraform_input_var_to_tfvars_json(input):

result = 'tfvars.%s = ' % name

if input['Default'] is not None:
if type(input['Default']) == dict:
# Was a default value provided?
if input['Default']['Value'] != '':
# Is it a complex value?
if type(input['Default']['Value']) in [dict, list]:
result += 'readJSON text: '
if input['Type'] in ['list', 'map']:
result += 'readJSON text: '

result += 'params.' + name
return result
Expand Down

0 comments on commit ce5bac8

Please sign in to comment.