1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Enabled export templates for secrets

This commit is contained in:
Jeremy Stretch
2018-07-17 10:34:50 -04:00
parent 6cc9ceb198
commit 5cf38b5ce9
3 changed files with 10 additions and 0 deletions

View File

@@ -376,6 +376,14 @@ class Secret(ChangeLoggedModel, CustomFieldModel):
def get_absolute_url(self):
return reverse('secrets:secret', args=[self.pk])
def to_csv(self):
return (
self.device,
self.role,
self.name,
self.plaintext or '',
)
def _pad(self, s):
"""
Prepend the length of the plaintext (2B) and pad with garbage to a multiple of 16B (minimum of 64B).