'Check whether a dataset has been created.
:param flocker.apiclient.Dataset expected: A dataset to match against
the results of ``list_datasets_state``.
:return: a Deferred that fires True if the expected dataset exists in
the cluster, or False otherwise.'

def _converged(self, expected):

    d = self.control_service.list_datasets_state()
    def dataset_matches(inspecting, expected):
        return ((expected.dataset_id == inspecting.dataset_id) and (expected.primary == inspecting.primary) and (inspecting.path is not None))
    def find_match(existing_state):
        return any((dataset_matches(state, expected) for state in existing_state))
    d.addCallback(find_match)
    return d
