hiera now passes through nil correctly
authorStephen Gran <steve@lobefin.net>
Sun, 31 May 2015 14:37:03 +0000 (15:37 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 31 May 2015 14:38:47 +0000 (15:38 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/motd/templates/motd.erb
modules/ssh/templates/authorized_keys.erb

index 6b4f640..5632823 100644 (file)
@@ -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"
index 2a56710..9963270 100644 (file)
@@ -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]}"