add datacenter location awareness with pseudo-driver (cmd and file)

This commit is contained in:
Solvik Blum 2019-08-04 01:11:53 +02:00
parent 396c4b5d10
commit 8b8cd68ff2
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47
7 changed files with 84 additions and 18 deletions

View file

@ -0,0 +1,11 @@
import re
import subprocess
def get(value, regex):
output = subprocess.getoutput(value)
r = re.search(regex, output)
if r:
result = r.group('datacenter')
return result
return None