From 502a768217c9d799d305aca3585b8049d057cd7c Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 31 May 2015 15:37:03 +0100 Subject: [PATCH] hiera now passes through nil correctly Signed-off-by: Stephen Gran --- modules/motd/templates/motd.erb | 2 +- modules/ssh/templates/authorized_keys.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb index 6b4f640ad..56328234f 100644 --- a/modules/motd/templates/motd.erb +++ b/modules/motd/templates/motd.erb @@ -107,7 +107,7 @@ unless vms.empty? end -if scope.lookupvar('::cluster').to_s != 'undefined' +if scope.lookupvar('::cluster') purp += "\n This server is a node in ganeti cluster: " purp += scope.lookupvar('::cluster').to_s + ":\n" purp += "\t" + scope.lookupvar('::cluster_nodes').split.sort.map{ |x| x.split('.')[0] }.join(", ") + ".\n" diff --git a/modules/ssh/templates/authorized_keys.erb b/modules/ssh/templates/authorized_keys.erb index 2a5671068..9963270f1 100644 --- a/modules/ssh/templates/authorized_keys.erb +++ b/modules/ssh/templates/authorized_keys.erb @@ -11,7 +11,7 @@ localkeys %> <%= ganetikeys = [] - if scope.lookupvar('::cluster').to_s != 'undefined' + if scope.lookupvar('::cluster') scope.lookupvar('::cluster_nodes').split.sort.each do |node| if allnodeinfo.has_key?(node) ganetikeys << "# for ganeti cluster #{scope.lookupvar('::cluster').to_s}: #{allnodeinfo[node]['hostname'][0]}" -- 2.20.1