lib/chef/knife/topo_import.rb in knife-topo-0.0.6 vs lib/chef/knife/topo_import.rb in knife-topo-0.0.7
- old
+ new
@@ -61,9 +61,14 @@
topologies.each do |topo_data|
topo_name = topo_data['name'] || topo_data['id']
topo_data['id'] ||= topo_name
+
+ if (!topo_name)
+ ui.error "Could not find a topology name - #{topo_file} does not appear to be a valid topology JSON file"
+ exit(1)
+ end
# check against specific topology list
if topo_names
if topo_names.include?(topo_name)
topo_names.delete(topo_name)