If _get_remote_defs() retrieved the API definitions from the Foreman server,
it tried to store them in the "definitions" subdirectory relative to the
foreman/client module. In a system-wide installation this would have usually
required to run the application using the module at least once with "root"
rights.
This makes the module use a "~/.python-foreman/definitions" directory instead
while still falling back to the system-wide "definitions" directory as
fallback, thereby allowing to continue shipping a set of API defs with
python-foreman.
If _get_remote_defs() retrieved the API definitions from the Foreman server, it tried to store them in the "definitions" subdirectory relative to the foreman/client module. In a system-wide installation this would have usually required to run the application using the module at least once with "root" rights.
This makes the module use a "~/.python-foreman/definitions" directory instead while still falling back to the system-wide "definitions" directory as fallback, thereby allowing to continue shipping a set of API defs with python-foreman.