lib/chef/knife/topo_export.rb in knife-topo-1.0.1 vs lib/chef/knife/topo_export.rb in knife-topo-1.1.0
- old
+ new
@@ -38,10 +38,21 @@
option :min_priority,
:long => "--min-priority PRIORITY",
:default => "default",
:description => "Export attributes with this priority or above"
+
+ option :topo,
+ :long => "--topo TOPOLOGY",
+ :description => "Name to use for the topology",
+ :default => "topo1"
+
+ option :all,
+ :long => "--all",
+ :description => "Export all topologies",
+ :boolean => true,
+ :default => false
def most_common (vals)
vals.group_by do |val|
val
end.values.max_by(&:size).first
@@ -49,11 +60,11 @@
def run
@bag_name = topo_bag_name(config[:data_bag])
- @topo_name = @name_args[0]
- @node_names = @name_args[1..-1]
+ @topo_name = config[:topo] unless config[:all]
+ @node_names = @name_args
unless ['default', 'normal', 'override'].include?(config[:min_priority])
ui.warn("--min-priority should be one of 'default', 'normal' or 'override'")
end