Skip to content

Commit

Permalink
better handle attrs in reports
Browse files Browse the repository at this point in the history
  • Loading branch information
furlongm committed Jun 19, 2024
1 parent 0580e9b commit 61f9cd8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions reports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ def parse(self, data, meta):
'reboot']

for attr in attrs:
setattr(self, attr, data.get(attr).strip())
if data.get(attr):
setattr(self, attr, data.get(attr))
else:
setattr(self, attr, '')

if self.host is not None:
if self.host:
self.host = self.host.lower()
fqdn = self.host.split('.', 1)
if len(fqdn) == 2:
Expand Down

0 comments on commit 61f9cd8

Please sign in to comment.