mirror of
https://github.com/bashclub/check-unifi-controller.git
synced 2024-12-25 12:50:12 +01:00
Update agent_unifi_controller: handle device names
UniFi UI allows people to create device names with blanks - of course these don't end up as valid hostnames. This is a very simplistic fix that replaces blanks with underscores. It allows for piggyback processing of the devices.
This commit is contained in:
parent
f3646613fd
commit
c4891a4318
@ -337,7 +337,7 @@ class unifi_device(unifi_object):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self._piggy_back:
|
if self._piggy_back:
|
||||||
_piggybackname = getattr(self,self._API.PIGGYBACK_ATTRIBUT,self.name)
|
_piggybackname = getattr(self,self._API.PIGGYBACK_ATTRIBUT,self.name).replace(" ", "_")
|
||||||
_ret = [f"<<<<{_piggybackname}>>>>"]
|
_ret = [f"<<<<{_piggybackname}>>>>"]
|
||||||
else:
|
else:
|
||||||
_ret = []
|
_ret = []
|
||||||
|
Loading…
Reference in New Issue
Block a user