def _check_hosts(service_instance, host, host_names):
 if (not host_names):
  host_name = _get_host_ref(service_instance, host)
  if host_name:
   host_names = [host]
  else:
   raise CommandExecutionError("No host reference found. If connecting to a vCenter Server, a list of 'host_names' must be provided.")
 elif (not isinstance(host_names, list)):
  raise CommandExecutionError("'host_names' must be a list.")
 return host_names

def _check_hosts ( service_instance , host , host_names ) : if ( not host_names ) : host_name = _get_host_ref ( service_instance , host ) if host_name : host_names = [ host ] else : raise CommandExecutionError ( "No host reference found. If connecting to a vCenter Server, a list of 'host_names' must be provided." ) elif ( not isinstance ( host_names , list ) ) : raise CommandExecutionError ( "'host_names' must be a list." ) return host_names
helper function that checks to see if the host provided is a vcenter server or an esxi host .