diff --git a/nomad/cli/client/mirror.py b/nomad/cli/client/mirror.py index 5dd9653f9c91ea2a521021c2bd909f09117dc3fb..78b2f091a9b0c8eedf232ad823f05b1d9c263fa2 100644 --- a/nomad/cli/client/mirror.py +++ b/nomad/cli/client/mirror.py @@ -97,7 +97,7 @@ def mirror( print('Cannot parse the given query %s: %s' % (query, str(e))) sys.exit(1) else: - query = {} + query = dict(published=True) utils.configure_logging() @@ -123,9 +123,14 @@ def mirror( continue except KeyError: pass - - upload_data = client.mirror.get_upload_mirror(upload_id=upload_id).response().result - n_calcs = len(upload_data.calcs) + + try: + upload_data = client.mirror.get_upload_mirror(upload_id=upload_id).response().result + n_calcs = len(upload_data.calcs) + except HTTPBadRequest: + print('Could not mirror %s, it is probably not published.' % upload_id) + n_calcs = 0 + continue if __in_test: # In tests, we mirror from our selves, remove it so it is not there for import