Updated init_state to include hashed username and password

This commit is contained in:
Anton Beloglazov 2012-10-02 15:17:25 +10:00
parent 16017f1154
commit 4ac6f18204
2 changed files with 5 additions and 2 deletions

View File

@ -180,7 +180,9 @@ def get_params(request):
def service():
params = get_params(bottle.request)
state = bottle.app().state
validate_params(state['config'], params)
validate_params(state['hashed_username'],
state['hashed_password'],
params)
if params['reason'] == 0:
log.info('Processing an underload of a host %s', params['host'])
execute_underload(

View File

@ -165,7 +165,8 @@ class GlobalManager(TestCase):
def test_service(self):
app = mock('app')
state = {'property': 'value'}
state = {'hashed_username': 'user',
'hashed_password': 'password'}
config = {'global_manager_host': 'localhost',
'global_manager_port': 8080}
app.state = {'state': state,