Commit 1a2d7520 authored by katharina.berger's avatar katharina.berger

fix

parent 894b8b21
......@@ -208,7 +208,7 @@ def unpublish_retracted(log,
solr_core='datasets')
for doc in docs_replica:
replica_list.add(docs_replica['instance_id'])
replica_list.add(doc['instance_id'])
# counter
num_datasets_unpublished = 0
......@@ -231,14 +231,18 @@ def unpublish_retracted(log,
solr_url=remote_slave_solr_url,
solr_core='datasets')
if len(docs1) > 0:
if docs1['retracted']:
# remove id from list
replica_list.remove(instance_id)
if docs1[0]['retracted']:
list_retracted.write('%s\n' % '#20'.join(instance_id.split('.v20')))
else:
list_removed.write('%s\n' % '#20'.join(instance_id.split('.v20')))
except:
log.error("Error querying index node %s" % remote_slave_solr_url)
# datasets that are unpublished using '--delete'
for instance_id in replica_list:
list_removed.write('%s\n' % '#20'.join(instance_id.split('.v20')))
list_retracted.close()
list_removed.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment