There is a bug in TrueNAS-12.0-RELEASE, which breaks commands like:
iocage list -h
iocage list -H
iocage list --header
I reported this bug already for 12.0-RC1, and there is a fix upstream, but for some reason the fix isn't included in the 12.0-RELEASE.
This bug affects many scripts, which do anything with iocage jails.
Here is a script, which fixes this bug by patching the correct file in TrueNAS-12.0-RELEASE.
The script does backup the original file. You can undo this patch by running the script with parameter
Script:
iocage list -h
iocage list -H
iocage list --header
I reported this bug already for 12.0-RC1, and there is a fix upstream, but for some reason the fix isn't included in the 12.0-RELEASE.
This bug affects many scripts, which do anything with iocage jails.
Here is a script, which fixes this bug by patching the correct file in TrueNAS-12.0-RELEASE.
The script does backup the original file. You can undo this patch by running the script with parameter
-uScript:
fix-iocage-list.shCode:
#!/bin/sh
FILE=/usr/local/lib/python3.8/site-packages/iocage_cli/list.py
if [ "$1" = "-u" ]
then
[ -f $FILE.bak ] && mv -f $FILE.bak $FILE && echo Successfully restored original file. || echo No backup found.
else
echo Patching file $FILE
cp -n $FILE $FILE.bak
sed -Ei '' 's/("message": "\\t".join)\(item\)/\1(map(lambda i: str(i or "-"), item))/' $FILE && echo Success. || echo Failed.
fi