# File lib/rudy/routines/startup.rb, line 102
102:     def raise_early_exceptions
103:       raise NoMachinesConfig unless @@config.machines
104:       # There's no keypair check here because Rudy::Machines will create one 
105:       raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
106:         
107:       unless (1..MAX_INSTANCES).member?(current_machine_count)
108:         raise "Instance count must be more than 0, less than #{MAX_INSTANCES}"
109:       end
110:       
111:       # If this is a testrun, we don't create instances anyway so
112:       # it doesn't matter if there are already instances running.
113:       if run? && !@@global.force
114:         if @@global.position.nil?
115:           raise MachineGroupAlreadyRunning, current_machine_group if Rudy::Machines.running?
116:           #raise MachineGroupMetadataExists, current_machine_group if Rudy::Machines.exists?
117:         else
118:           if Rudy::Machines.running? @@global.position
119:             m = Rudy::Machine.new @@global.position
120:             raise MachineAlreadyRunning, m.name 
121:           end
122:         end
123:       end
124:       
125:       if @routine
126:         bad = @routine.keys - @@allowed_actions
127:         raise UnsupportedActions.new(@name, bad) unless bad.empty?
128:       end
129:     end