lib/sfn/command/describe.rb in sfn-0.5.0 vs lib/sfn/command/describe.rb in sfn-1.0.0
- old
+ new
@@ -13,21 +13,27 @@
end
# Run the stack describe action
def execute!
stack_name = name_args.last
- stack = provider.connection.stacks.get(stack_name)
- if(stack)
- display = [].tap do |to_display|
- AVAILABLE_DISPLAYS.each do |display_option|
- if(config[display_option])
- to_display << display_option
+ root_stack = api_action! do
+ provider.connection.stacks.get(stack_name)
+ end
+ if(root_stack)
+ ([root_stack] + root_stack.nested_stacks).compact.each do |stack|
+ ui.info "Stack description of #{ui.color(stack.name, :bold)}:"
+ display = [].tap do |to_display|
+ AVAILABLE_DISPLAYS.each do |display_option|
+ if(config[display_option])
+ to_display << display_option
+ end
end
end
- end
- display = AVAILABLE_DISPLAYS.dup if display.empty?
- display.each do |display_method|
- self.send(display_method, stack)
+ display = AVAILABLE_DISPLAYS.dup if display.empty?
+ display.each do |display_method|
+ self.send(display_method, stack)
+ end
+ ui.puts
end
else
ui.fatal "Failed to find requested stack: #{ui.color(stack_name, :bold, :red)}"
exit -1
end