def compare_dataset_state(discovered_dataset, desired_dataset):
 if (discovered_dataset is None):
  return ((desired_dataset is None) or (desired_dataset.state == DatasetStates.DELETED))
 if (desired_dataset is None):
  return (discovered_dataset.state == DatasetStates.NON_MANIFEST)
 if ((desired_dataset.state == DatasetStates.DELETED) and (discovered_dataset.state == DatasetStates.REGISTERED)):
  return True
 if (discovered_dataset.state != desired_dataset.state):
  return False
 if (discovered_dataset.state == DatasetStates.MOUNTED):
  return (discovered_dataset.mount_point == desired_dataset.mount_point)
 elif (discovered_dataset.state == DatasetStates.NON_MANIFEST):
  return True
 elif (discovered_dataset.state == DatasetStates.DELETED):
  return True
 else:
  raise ValueError('Impossible dataset states: {} {}'.format(discovered_dataset, desired_dataset))

def compare_dataset_state ( discovered_dataset , desired_dataset ) : if ( discovered_dataset is None ) : return ( ( desired_dataset is None ) or ( desired_dataset . state == DatasetStates . DELETED ) ) if ( desired_dataset is None ) : return ( discovered_dataset . state == DatasetStates . NON_MANIFEST ) if ( ( desired_dataset . state == DatasetStates . DELETED ) and ( discovered_dataset . state == DatasetStates . REGISTERED ) ) : return True if ( discovered_dataset . state != desired_dataset . state ) : return False if ( discovered_dataset . state == DatasetStates . MOUNTED ) : return ( discovered_dataset . mount_point == desired_dataset . mount_point ) elif ( discovered_dataset . state == DatasetStates . NON_MANIFEST ) : return True elif ( discovered_dataset . state == DatasetStates . DELETED ) : return True else : raise ValueError ( 'Impossible dataset states: {} {}' . format ( discovered_dataset , desired_dataset ) )
compare a discovered dataset to a desired dataset to determine if they have converged .