@@ -322,13 +322,15 @@ def _print_testbed_info(self):
322322 +---------------------------------------------------------+
323323 """
324324
325- if not self .vcenter_info ['hostname' ] and \
326- 'vcenter_hostname' in self .testing_vars and \
327- self .testing_vars ['vcenter_hostname' ]:
325+ if (self .testing_vars and
326+ not self .vcenter_info ['hostname' ] and
327+ 'vcenter_hostname' in self .testing_vars and
328+ self .testing_vars ['vcenter_hostname' ]):
328329 self .vcenter_info ['hostname' ] = self .testing_vars ['vcenter_hostname' ]
329- if not self .esxi_info ['hostname' ] and \
330- 'esxi_hostname' in self .testing_vars and \
331- self .testing_vars ['esxi_hostname' ]:
330+ if (self .testing_vars and
331+ not self .esxi_info ['hostname' ] and
332+ 'esxi_hostname' in self .testing_vars and
333+ self .testing_vars ['esxi_hostname' ]):
332334 self .esxi_info ['hostname' ] = self .testing_vars ['esxi_hostname' ]
333335
334336 msg = "Testbed information:\n "
@@ -408,7 +410,9 @@ def _print_vm_info(self):
408410 # Get VM name from testing vars file and set log dir
409411 msg = 'VM information:\n '
410412
411- if 'vm_name' in self .testing_vars and self .testing_vars ['vm_name' ]:
413+ if (self .testing_vars and
414+ 'vm_name' in self .testing_vars and
415+ self .testing_vars ['vm_name' ]):
412416 self .vm_info ['VM Name' ] = self .testing_vars ['vm_name' ]
413417 else :
414418 msg += "Not found VM information\n "
0 commit comments