def expand_stack(stack)
      logger.info "Stack expansion requested (#{stack.id})"
      if ((stack.in_progress? && Time.now.to_i - stack.attributes["Cached"].to_i > stack_expansion_interval) ||
          !stack.attributes["Cached"])
        begin
          expanded = false
          cache.locked_action(:stack_expansion_lock) do
            expanded = true
            stack.reload
            stack.data["Cached"] = Time.now.to_i
          end
          if expanded
            save_expanded_stack(stack.id, stack.to_json)
          end
        rescue => e
          logger.error "Stack expansion failed (#{stack.id}) - #{e.class}: #{e}"
        end
      else
        logger.info "Stack has been cached within expand interval. Expansion prevented. (#{stack.id})"
      end
    end
def expand_stack(stack)
      logger.info "Stack expansion requested (#{stack.id})"
      if ((stack.in_progress? && Time.now.to_i - stack.attributes["Cached"].to_i > stack_expansion_interval) ||
          !stack.attributes["Cached"])
        begin
          expanded = false
          cache.locked_action(:stack_expansion_lock) do
            expanded = true
            stack.reload
            stack.data["Cached"] = Time.now.to_i
          end
          if expanded
            save_expanded_stack(stack.id, stack.to_json)
          end
        rescue => e
          logger.error "Stack expansion failed (#{stack.id}) - #{e.class}: #{e}"
        end
      else
        logger.info "Stack has been cached within expand interval. Expansion prevented. (#{stack.id})"
      end
    end
Expand all lazy loaded attributes within stack

 @param stack [Miasma::Models::Orchestration::Stack]