I am trying to create a python script to install and configure certain program automatically in linux machines.
My idea is to use the platform and multiprocessing libraries to ask for system information (platform.system, platform.linux_distribution, multiprocessing.cpu_count, etc), and then install the software and create a text file for the software configuration depending on what I get with those calls.
I am having problems determining the OS and distro: I need to know what linux distribution the script is running in so I can launch the appropriate command, and the information I am looking for is not on the python documentation.
According to that documentation ( http://docs.python.org/2/library/platform.html ), platform.system
Returns the system/OS name, e.g. 'Linux', 'Windows', or 'Java'. An empty string is returned if the value cannot be determined.
and platform.linux_distribution
Tries to determine the name of the Linux OS distribution name.
(...)
Returns a tuple (distname,version,id) which defaults to the args given as parameters. id is the item in parentheses after the version number. It is usually the version codename.
But it's not specific enough and does not mention any particular cases.
I have tried these variables on my machine (platform.system returns 'Linux' and platform.linux_distribution 'debian'), but I have no way of trying it in other systems (And I don't think it's feasible to create virtual machines for every linux distro out there and try it in each one)
I need to know exactly what distname string platform.linux_distribution outputs in different linux distributions so I can use those values in my script.
I also need confirmation about if platform.system returns the same thing in every single linux distribution. Are there any exceptions to this?