def get_connected_hosts(session, datastore):
 host_mounts = session._call_method(vutil, 'get_object_property', datastore, 'host')
 if (not hasattr(host_mounts, 'DatastoreHostMount')):
  return []
 connected_hosts = []
 for host_mount in host_mounts.DatastoreHostMount:
  connected_hosts.append(host_mount.key.value)
 return connected_hosts

def get_connected_hosts ( session , datastore ) : host_mounts = session . _call_method ( vutil , 'get_object_property' , datastore , 'host' ) if ( not hasattr ( host_mounts , 'DatastoreHostMount' ) ) : return [ ] connected_hosts = [ ] for host_mount in host_mounts . DatastoreHostMount : connected_hosts . append ( host_mount . key . value ) return connected_hosts
get all the hosts to which the datastore is connected .