Problem with the optional parameters in the post install script

This commit is contained in:
Lord Anton Hvornum 2018-04-07 17:41:47 +02:00
parent 8dedabbf76
commit 88f1f85bf4
1 changed files with 3 additions and 2 deletions

View File

@ -263,10 +263,11 @@ if __name__ == '__main__':
for title in instructions:
print('[N] {}'.format(title))
for command in instructions[title]:
opts = instructions[title][command] if instructions[title][command] else {}
opts = instructions[title][command] if type(instructions[title][command]) in (dict, oDict) else {}
print('[N] Command: {} ({})'.format(command, opts))
o = run('arch-chroot /mnt {c}'.format(c=command), echo=True, **opts)
if instructions[title][command] and not instructions[title][command] in o:
if len(instructions[title][command]) and type(instructions[title][command]) == bytes and not instructions[title][command] in o:
print('[W] Post install command failed: {}'.format(o.decode('UTF-8')))
#print(o)