Skip to content

Commit

Permalink
Fixed decoding of encoded identifiers (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
roll authored and akariv committed Sep 24, 2019
1 parent eed93ea commit e95891e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions datapackage_pipelines/status/backend_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ def reset(self):
self.del_status(p)

def all_pipeline_ids(self):
all_ids = sorted(os.listdir(self.base_dir))
all_ids = [
codecs.decode(_id.encode('utf8'), 'base64').decode('utf8')
for _id in all_ids
]
return all_ids
# Decoding encoded identifiers
dec_ids = []
enc_ids = sorted(os.listdir(self.base_dir))
for enc_id in enc_ids:
dec_id = codecs.decode(enc_id.encode('utf8'), 'base64').decode('utf8')
if dec_id.startswith('PipelineStatus:'):
dec_id = dec_id.replace('PipelineStatus:', '')
dec_ids.append(dec_id)
return dec_ids

def all_statuses(self):
return [self.get_status(_id)
Expand Down

0 comments on commit e95891e

Please sign in to comment.