1 import subprocess
2
3
5 try:
6 cmd = ['lsb_release', '-si']
7 pop = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
8 (std_out, std_err) = pop.communicate()
9 return std_out.strip()
10 except:
11 return None
12
14 try:
15 cmd = ['lsb_release', '-sc']
16 pop = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
17 (std_out, std_err) = pop.communicate()
18 return std_out.strip()
19 except:
20 return None
21
23 try:
24 cmd = ['lsb_release', '-sr']
25 pop = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
26 (std_out, std_err) = pop.communicate()
27 return std_out.strip()
28 except:
29 return None
30