autotest/virt-test — pull request #242 by ldoktor (2013-03-18 18:08:47+00:00)
Title: virttest.utils_params: Improve message of missing key

There are many places where we require a param There are lots of in-test custom checks and custom messages of missing params. This might be one of the solutions to simplify handling of required params.

Instead of:

something = params.get('some_key')
if not something:
raise error.TestError('Missing config "some_key"')

You can use generic exception, which was tweaked to suit this purpose:

something = params['some_key']

Additionally with this patch we can avoid weird errors by using checking for all required params (which is currently not done and there are lots of places where we execute session.cmd(None) or None.split()...).