Skip to content

Commit

Permalink
[COOK-3617] Fix no method chomp on NilClass attribute errors
Browse files Browse the repository at this point in the history
    The hostname/myhost/mydomain attributes try to chomp on a `nil` value, mainly the node["domain"] attribute. Additionally, || is used after a chomp, so empty string values will probably never hit the second half of the statement.

Signed-off-by: Seth Vargo <[email protected]>
  • Loading branch information
claco authored and sethvargo committed Sep 30, 2013
1 parent 5e06cdc commit 5e975b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
# Non-default main.cf attributes
default['postfix']['main']['biff'] = "no"
default['postfix']['main']['append_dot_mydomain'] = "no"
default['postfix']['main']['myhostname'] = node['fqdn'].chomp('.') || node['hostname'].chomp('.')
default['postfix']['main']['mydomain'] = node['domain'].chomp('.') || node['hostname'].chomp('.')
default['postfix']['main']['myhostname'] = (node['fqdn'] || node['hostname']).to_s.chomp('.')
default['postfix']['main']['mydomain'] = (node['domain'] || node['hostname']).to_s.chomp('.')
default['postfix']['main']['myorigin'] = "$myhostname"
default['postfix']['main']['mydestination'] = [ node['postfix']['main']['myhostname'], node['hostname'], "localhost.localdomain", "localhost" ].compact
default['postfix']['main']['smtpd_use_tls'] = "yes"
Expand Down

0 comments on commit 5e975b5

Please sign in to comment.