mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add exception wrapper
This commit is contained in:
@ -65,12 +65,15 @@ class FreeRADIUSClientsRenderer(renderers.BaseRenderer):
|
|||||||
|
|
||||||
def render(self, data, media_type=None, renderer_context=None):
|
def render(self, data, media_type=None, renderer_context=None):
|
||||||
clients = []
|
clients = []
|
||||||
for secret in data:
|
try:
|
||||||
if secret['device']['primary_ip'] and secret['plaintext']:
|
for secret in data:
|
||||||
client = self.CLIENT_TEMPLATE.format(
|
if secret['device']['primary_ip'] and secret['plaintext']:
|
||||||
name=secret['device']['name'],
|
client = self.CLIENT_TEMPLATE.format(
|
||||||
ip=secret['device']['primary_ip']['address'].split('/')[0],
|
name=secret['device']['name'],
|
||||||
secret=secret['plaintext']
|
ip=secret['device']['primary_ip']['address'].split('/')[0],
|
||||||
)
|
secret=secret['plaintext']
|
||||||
clients.append(client)
|
)
|
||||||
|
clients.append(client)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return '\n'.join(clients)
|
return '\n'.join(clients)
|
||||||
|
Reference in New Issue
Block a user