# File lib/rudy/routines/shutdown.rb, line 25
25:     def execute
26:       
27:       # We need to remove after_local so the runner doesn't see it
28:       after_local = @routine.delete(:after_local)
29:       
30:       if run?
31:         Rudy::Routines.rescue {
32:           Rudy::Routines::Handlers::Group.authorize rescue nil
33:         }
34:         
35:         Rudy::Routines::Handlers::Depends.execute_all @before, @argv
36:         
37:         li " Executing routine: #{@name} ".att(:reverse), ""
38:         ld "[this is a generic routine]" if @routine.empty?
39:         
40:         # Re-retreive the machine set to reflect dependency changes
41:         Rudy::Routines.rescue {
42:           @machines = Rudy::Machines.list || []
43:           @@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
44:         }
45:         
46:         # This is the meat of the sandwich
47:         Rudy::Routines.runner(@routine, @@rset, @@lbox, @argv)
48:         
49:         @machines.each do |machine|
50:           Rudy::Routines.rescue { machine.destroy }
51:         end
52:       
53:         if after_local
54:           handler = Rudy::Routines.get_handler :local
55:           Rudy::Routines.rescue {
56:             handler.execute(:local, after_local, nil, @@lbox, @argv)
57:           }
58:         end
59:       
60:         Rudy::Routines::Handlers::Depends.execute_all @after, @argv
61:       end
62:       
63:       @machines
64:     end