Commit f9014b11 authored by katharina.berger's avatar katharina.berger

fix

parent 1a2d7520
......@@ -210,14 +210,17 @@ def unpublish_retracted(log,
for doc in docs_replica:
replica_list.add(doc['instance_id'])
replica_list_tmp = replica_list
# counter
num_datasets_unpublished = 0
list_retracted = open('~/unpublish_retracted_datasets_%s.txt' % datetime.datetime.today().strftime('%Y%m%d'), 'w')
list_removed = open('~/unpublish_deleted_datasets_%s.txt' % datetime.datetime.today().strftime('%Y%m%d'), 'w')
list_retracted = open('/esg/log/unpublish_replica/unpublish_retracted_datasets_%s.txt' % datetime.datetime.today().strftime('%Y%m%d'), 'w')
list_removed = open('/esg/log/unpublish_replica/unpublish_deleted_datasets_%s.txt' % datetime.datetime.today().strftime('%Y%m%d'), 'w')
# query all remote index nodes for at DKRZ published replica
index_nodes, master_solr_dict = get_list_of_shards(log, config, esgf_index_node_url)
for instance_id in replica_list:
for index_node in index_nodes:
for index_node in index_nodes:
replica_list = replica_list_tmp
for instance_id in replica_list:
try:
if index_node in master_solr_dict:
remote_slave_solr_url = 'http://esgf-data.dkrz.de:%s/solr' % master_solr_dict[index_node]
......@@ -232,7 +235,7 @@ def unpublish_retracted(log,
solr_core='datasets')
if len(docs1) > 0:
# remove id from list
replica_list.remove(instance_id)
replica_list_tmp.remove(instance_id)
if docs1[0]['retracted']:
list_retracted.write('%s\n' % '#20'.join(instance_id.split('.v20')))
......
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