Skip to content

Commit

Permalink
Use fetch_path to handle the case where :ws_values is nil.
Browse files Browse the repository at this point in the history
When :ws_values is nil, CustomizationTemplate.substitute_erb throws out [NoMethodError]: undefined method `[]' for nil:NilClass.

https://bugzilla.redhat.com/show_bug.cgi?id=1436194
  • Loading branch information
lfu committed Apr 18, 2017
1 parent 5164cd8 commit fbf87f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/fixtures/customization_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@

- :name: SSH key addition template
:description: This template enables placing ssh public key in authorized keys
:script: "#cloud-config\nusers:\n - name: root\n ssh-authorized-keys:\n - <%= evm[:ws_values][:ssh_public_key] %>"
:script: "#cloud-config\nusers:\n - name: root\n ssh-authorized-keys:\n - <%= evm.fetch_path(:ws_values, :ssh_public_key) %>"
:type: CustomizationTemplateCloudInit
:system: true

Expand Down

0 comments on commit fbf87f1

Please sign in to comment.