def _is_datastore_valid(propdict, datastore_regex, ds_types):
 return (propdict.get('summary.accessible') and ((propdict.get('summary.maintenanceMode') is None) or (propdict.get('summary.maintenanceMode') == 'normal')) and (propdict['summary.type'] in ds_types) and ((datastore_regex is None) or datastore_regex.match(propdict['summary.name'])))

def _is_datastore_valid ( propdict , datastore_regex , ds_types ) : return ( propdict . get ( 'summary.accessible' ) and ( ( propdict . get ( 'summary.maintenanceMode' ) is None ) or ( propdict . get ( 'summary.maintenanceMode' ) == 'normal' ) ) and ( propdict [ 'summary.type' ] in ds_types ) and ( ( datastore_regex is None ) or datastore_regex . match ( propdict [ 'summary.name' ] ) ) )
checks if a datastore is valid based on the following criteria .