102: def raise_early_exceptions
103: raise NoMachinesConfig unless @@config.machines
104:
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:
112:
113: if run? && !@@global.force
114: if @@global.position.nil?
115: raise MachineGroupAlreadyRunning, current_machine_group if Rudy::Machines.running?
116:
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