diff --git a/neat/globals/manager.py b/neat/globals/manager.py index db8d2e3..cda8b0e 100644 --- a/neat/globals/manager.py +++ b/neat/globals/manager.py @@ -189,22 +189,25 @@ def service(): validate_params(state['state']['hashed_username'], state['state']['hashed_password'], params) - try: - if params['reason'] == 0: - log.info('Processing an underload of a host %s', params['host']) - execute_underload( - state['config'], - state['state'], - params['host']) - else: - log.info('Processing an overload, VMs: %s', str(params['vm_uuids'])) - execute_overload( - state['config'], - state['state'], - params['vm_uuids']) - except: - log.exception('Exception during request processing:') - raise + log.info('Received a request from %s: %s', + bottle.request.remote_addr, + str(params)) + # try: + # if params['reason'] == 0: + # log.info('Processing an underload of a host %s', params['host']) + # execute_underload( + # state['config'], + # state['state'], + # params['host']) + # else: + # log.info('Processing an overload, VMs: %s', str(params['vm_uuids'])) + # execute_overload( + # state['config'], + # state['state'], + # params['vm_uuids']) + # except: + # log.exception('Exception during request processing:') + # raise @bottle.route('/', method='ANY') diff --git a/tests/globals/test_manager.py b/tests/globals/test_manager.py index 0f5af17..4d1b37a 100644 --- a/tests/globals/test_manager.py +++ b/tests/globals/test_manager.py @@ -165,26 +165,26 @@ class GlobalManager(TestCase): app.state = {'state': state, 'config': config} - with MockTransaction: - params = {'reason': 0, - 'host': 'host'} - expect(manager).get_params(Any).and_return(params).once() - expect(bottle).app().and_return(app).once() - expect(manager).validate_params('user', 'password', params). \ - and_return(True).once() - expect(manager).execute_underload(config, state, 'host').once() - manager.service() + # with MockTransaction: + # params = {'reason': 0, + # 'host': 'host'} + # expect(manager).get_params(Any).and_return(params).once() + # expect(bottle).app().and_return(app).once() + # expect(manager).validate_params('user', 'password', params). \ + # and_return(True).once() + # expect(manager).execute_underload(config, state, 'host').once() + # manager.service() - with MockTransaction: - params = {'reason': 1, - 'vm_uuids': 'vm_uuids'} - expect(manager).get_params(Any).and_return(params).once() - expect(bottle).app().and_return(app).once() - expect(manager).validate_params('user', 'password', params). \ - and_return(True).once() - expect(manager).execute_overload(config, state, 'vm_uuids'). \ - once() - manager.service() + # with MockTransaction: + # params = {'reason': 1, + # 'vm_uuids': 'vm_uuids'} + # expect(manager).get_params(Any).and_return(params).once() + # expect(bottle).app().and_return(app).once() + # expect(manager).validate_params('user', 'password', params). \ + # and_return(True).once() + # expect(manager).execute_overload(config, state, 'vm_uuids'). \ + # once() + # manager.service() @qc(20) def vms_by_host(