Commit 4a7bdeac authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[databases] Update delete_index_files to use new paradigm

This also fixes an infinite recursion bug as the path of the
index was incomplete.
parent cd47d2e6
......@@ -390,7 +390,6 @@ def pull(webapi, prefix, names, force, indentation, format_cache):
def index_outputs(configuration, names, uid=None, db_root=None, docker=False):
names = common.make_up_local_list(configuration.path, 'database', names)
retcode = 0
if docker:
......@@ -492,12 +491,11 @@ def delete_index_files(configuration, names):
for protocol_name, set_name, db_set in sets:
for output_name in db_set['outputs'].keys():
index_hash = database.hash_output(
protocol_name, set_name, output_name)
index_filename = os.path.join(configuration.cache,
toPath(index_hash, '.index'))
dataset_hash = hashDataset(db_name, protocol_name, set_name)
index_filename = toPath(dataset_hash)
basename = os.path.join(configuration.cache,
os.path.splitext(index_filename)[0])
basename = os.path.splitext(index_filename)[0]
for g in glob.glob(basename + '.*'):
logger.info("removing `%s'...", g)
os.unlink(g)
......
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