lib/chef/knife/topo_cookbook_upload.rb in knife-topo-0.0.7 vs lib/chef/knife/topo_cookbook_upload.rb in knife-topo-0.0.8
- old
+ new
@@ -63,13 +63,16 @@
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
+ cookbook_names = []
if topo['cookbook_attributes'] && topo['cookbook_attributes'].length > 0
argPos = 2
topo['cookbook_attributes'].each do |entry|
- @topo_upload_args[argPos] = entry['cookbook']
+ cookbook_name = entry['cookbook']
+ @topo_upload_args[argPos] = cookbook_name unless cookbook_names.include?(cookbook_name)
+ cookbook_names << cookbook_name
argPos += 1
end
run_cmd(Chef::Knife::CookbookUpload, @topo_upload_args)
else
ui.info("No cookbooks found for topology #{topo_name}")