I'm using this script on a prod system where I don't have root access so I can't install the crypto packages. I still got it to work, but during the process I would suggest the following updates are made to the script and documentation. Crypto can't be used without installing it as root, but this isn't needed for all configurations.
Add 'configparser' to requirements.txt
Update readme.md to use the python3 recommended way to install packages: python3 -m pip install -r requirements.txt
Update readme.md to include pip user installation when root cannot be used: python3 -m pip install --user -r requirements.txt
Don't quit the script when the crypto packages aren't found. This can be accomplished with the sample code below:
try:
import M2Crypto
except ModuleNotFoundError:
print("WARNING: M2Crypto package is not available")
try:
from Crypto.Cipher import AES
except ModuleNotFoundError:
print("WARNING: pycrypto package is not available")
I'm using this script on a prod system where I don't have root access so I can't install the crypto packages. I still got it to work, but during the process I would suggest the following updates are made to the script and documentation. Crypto can't be used without installing it as root, but this isn't needed for all configurations.
try: import M2Crypto except ModuleNotFoundError: print("WARNING: M2Crypto package is not available")
try: from Crypto.Cipher import AES except ModuleNotFoundError: print("WARNING: pycrypto package is not available")