title: How do I detect the Ubuntu version?
body: <p>I'm currently writing a Python app that changes some network configuration files. The app needs to run on Ubuntu 10.04 to 13.10. The problem is, that NetworkManager is broken in different ways on different versions (though they seem to have finally fixed it in 13.04+), and this causes incompatibilities with my app. </p>
  
  <p>I've figured out the problems on each version and developed workarounds for them, I'm just not sure what the best way is to detect which version of Ubuntu the user is running.</p>
  
  <p>The best solution I've come up with so far is to parse the output of <code>lsb_release -a</code>, but this seems to be a rather fragile solution and would probably fail with Ubuntu-derived distributions such as Mint and possibly even with some of the "official" variants (Kubuntu, Xubuntu, etc.).</p>
  
  <p>Is there a good way to detect the <em>base</em> distribution and version for a given Linux distribution so I can base the choices my app makes on that version? </p>