rack awareness

This commit is contained in:
Solvik Blum 2019-08-05 11:54:06 +02:00
parent 8e40495eb7
commit acbb767e22
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47
7 changed files with 129 additions and 50 deletions

View file

@ -0,0 +1,10 @@
import re
import subprocess
def get(value, regex):
output = subprocess.getoutput(value)
r = re.search(regex, output)
if r and len(r.groups()) > 0:
return r.groups()[0]
return None