FIX randomdir needs eid

This commit is contained in:
boyska 2018-08-03 15:14:59 +02:00
parent 2cce020fab
commit 0d2e28e380

View file

@ -39,7 +39,12 @@ def generate(spec):
picked = random.sample(found_files, int(spec['howmany']))
nick = spec.get('nick', spec.eid)
nick = spec.get('nick', '')
if not nick:
if hasattr(spec, 'eid'):
nick = spec.eid
else:
nick = 'NONICK'
for path in picked:
tmp = mkstemp(suffix=os.path.splitext(path)[-1],
prefix='randomdir-%s-%s-' % (shortname(nick),