add datacenter location awareness with pseudo-driver (cmd and file)
This commit is contained in:
parent
396c4b5d10
commit
8b8cd68ff2
7 changed files with 84 additions and 18 deletions
11
netbox_agent/drivers/datacenter_cmd.py
Normal file
11
netbox_agent/drivers/datacenter_cmd.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue