avocado.plugins.vm: Use more informative exception messages

Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 fa6e1a21
......@@ -115,13 +115,19 @@ class VMTestResult(TestResult):
def setup(self):
if self.args.vm_domain is None:
self.stream.error('Please, set Virtual Machine Domain with option --vm-domain.')
raise exceptions.TestSetupFail()
e_msg = ('Please set Virtual Machine Domain with option '
'--vm-domain.')
self.stream.error(e_msg)
raise exceptions.TestSetupFail(e_msg)
if self.args.vm_hostname is None:
self.stream.error('Please, set Virtual Machine hostname with option --vm-hostname.')
raise exceptions.TestSetupFail()
self.stream.log_header("REMOTE TESTS: Virtual Machine Domain '%s'" % self.args.vm_domain)
self.stream.log_header("REMOTE TESTS: Host login '%s@%s'" % (self.args.vm_username, self.args.vm_hostname))
e_msg = ('Please set Virtual Machine hostname with option '
'--vm-hostname.')
self.stream.error(e_msg)
raise exceptions.TestSetupFail(e_msg)
self.stream.log_header("REMOTE TESTS: Virtual Machine Domain '%s'" %
self.args.vm_domain)
self.stream.log_header("REMOTE TESTS: Host login '%s@%s'" %
(self.args.vm_username, self.args.vm_hostname))
self.vm = virt.vm_connect(self.args.vm_domain,
self.args.vm_hypervisor_uri)
if self.vm is None:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册