lib/chef/knife/topo_cookbook_upload.rb in knife-topo-0.0.6 vs lib/chef/knife/topo_cookbook_upload.rb in knife-topo-0.0.7

- old
+ new

@@ -63,18 +63,18 @@ ui.fatal("Topology file #{topologies_path}/#{bag_name}/#{topo_name}.json not found - use 'knife topo import' first") exit(1) end # Run cookbook upload command on the topology cookbooks - if topo['cookbook_attributes'].length > 0 + if topo['cookbook_attributes'] && topo['cookbook_attributes'].length > 0 argPos = 2 topo['cookbook_attributes'].each do |entry| @topo_upload_args[argPos] = entry['cookbook'] argPos += 1 end run_cmd(Chef::Knife::CookbookUpload, @topo_upload_args) else - ui.info("No cookbooks found for topology #{topo_name}.") + ui.info("No cookbooks found for topology #{topo_name}") end end include Chef::Knife::TopologyHelper