def fetch_routine_config(action)
      raise "No action specified" unless action
      raise NoConfig unless @@config
      raise NoRoutinesConfig unless @@config.routines
      raise NoGlobal unless @@global
      
      action = action.to_s.tr('-:', '_')
      
      zon, env, rol = @@global.zone, @@global.environment, @@global.role
      
      disk_defs = fetch_machine_param(:disks) || {}
      
      # We want to find only one routines config with the name +action+. 
      # This is unlike the routines config where it's okay to merge via
      # precedence. 
      routine = @@config.routines.find_deferred(@@global.environment, @@global.role, action)
      routine ||= @@config.routines.find_deferred([@@global.environment, @@global.role], action)
      routine ||= @@config.routines.find_deferred(@@global.role, action)
      return nil unless routine
      return routine unless routine.has_key?(:disks)
      
      routine.disks.each_pair do |raction,disks|
        unless disks.kind_of?(Hash)
          li "#{raction} is not defined. Check your #{action} routines config.".color(:red)
          next
        end
        disks.each_pair do |path, props|
          unless disk_defs.has_key?(path)
            li "#{path} is not defined. Check your machines config.".color(:red)
            routine.disks[raction].delete(path) 
            next
          end
          
          routine.disks[raction][path] = disk_defs[path].merge(props) 
          
        end
      end

      routine
    end
def fetch_routine_config(action)
      raise "No action specified" unless action
      raise NoConfig unless @@config
      raise NoRoutinesConfig unless @@config.routines
      raise NoGlobal unless @@global
      
      action = action.to_s.tr('-:', '_')
      
      zon, env, rol = @@global.zone, @@global.environment, @@global.role
      
      disk_defs = fetch_machine_param(:disks) || {}
      
      # We want to find only one routines config with the name +action+. 
      # This is unlike the routines config where it's okay to merge via
      # precedence. 
      routine = @@config.routines.find_deferred(@@global.environment, @@global.role, action)
      routine ||= @@config.routines.find_deferred([@@global.environment, @@global.role], action)
      routine ||= @@config.routines.find_deferred(@@global.role, action)
      return nil unless routine
      return routine unless routine.has_key?(:disks)
      
      routine.disks.each_pair do |raction,disks|
        unless disks.kind_of?(Hash)
          li "#{raction} is not defined. Check your #{action} routines config.".color(:red)
          next
        end
        disks.each_pair do |path, props|
          unless disk_defs.has_key?(path)
            li "#{path} is not defined. Check your machines config.".color(:red)
            routine.disks[raction].delete(path) 
            next
          end
          
          routine.disks[raction][path] = disk_defs[path].merge(props) 
          
        end
      end

      routine
    end
We grab the appropriate routines config and check the paths
 against those defined for the matching machine group.
 Disks that appear in a routine but not in a machine will be
 removed and a warning printed. Otherwise, the routines config
 is merged on top of the machine config and that's what we return.

 This means that all the disk info is returned so we know what
 size they are and stuff.
 Return a hash:

      :after:
      - :root: !ruby/object:Proc {}
      - :rudy: !ruby/object:Proc {}
      :disks:
        :create:
          /rudy/example1:
            :device: /dev/sdr
            :size: 2
          /rudy/example2:
            :device: /dev/sdm
            :size: 1

 NOTE: dashes in +action+ are converted to underscores. We do this
 because routine names are defined by method names and valid
 method names don't use dashes. This way, we can use a dash on the
 command-line which looks nicer (underscore still works of course).