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
9
netbox_agent/drivers/datacenter_file.py
Normal file
9
netbox_agent/drivers/datacenter_file.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import re
|
||||
|
||||
|
||||
def get(value, regex):
|
||||
for line in open(value, 'r'):
|
||||
r = re.search(regex, line)
|
||||
if r:
|
||||
return r.group('datacenter')
|
||||
return None
|
Loading…
Add table
Add a link
Reference in a new issue