add datacenter location awareness with pseudo-driver (cmd and file) #4
1 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,16 @@ from netbox_agent.config import DATACENTER_LOCATION, DATACENTER_LOCATION_DRIVER_
|
||||||
|
|
||||||
class Datacenter():
|
class Datacenter():
|
||||||
"""
|
"""
|
||||||
|
This class is used to guess the datacenter in order to push the information
|
||||||
|
in Netbox for a `Device`
|
||||||
|
|
||||||
|
A driver takes a `value` and evaluates a regex with a `named group`: `datacenter`.
|
||||||
|
|
||||||
|
There's embeded drivers such as `file` or `cmd` which read a file or return the
|
||||||
|
output of a file.
|
||||||
|
|
||||||
|
There's also a support for an external driver file outside of this project in case
|
||||||
|
the logic isn't supported here.
|
||||||
"""
|
"""
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.driver = DATACENTER_LOCATION.split(':')[0]
|
self.driver = DATACENTER_LOCATION.split(':')[0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue