Skip to content

Commit

Permalink
Fixes #15322: Add description field to YAML export for device & modul…
Browse files Browse the repository at this point in the history
…e types
  • Loading branch information
jeremystretch committed Mar 13, 2024
1 parent 7ac2169 commit 8bdbb49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions netbox/dcim/models/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,16 @@ def to_yaml(self):
'manufacturer': self.manufacturer.name,
'model': self.model,
'slug': self.slug,
'description': self.description,
'default_platform': self.default_platform.name if self.default_platform else None,
'part_number': self.part_number,
'u_height': float(self.u_height),
'is_full_depth': self.is_full_depth,
'subdevice_role': self.subdevice_role,
'airflow': self.airflow,
'comments': self.comments,
'weight': float(self.weight) if self.weight is not None else None,
'weight_unit': self.weight_unit,
'comments': self.comments,
}

# Component templates
Expand Down Expand Up @@ -415,9 +416,10 @@ def to_yaml(self):
'manufacturer': self.manufacturer.name,
'model': self.model,
'part_number': self.part_number,
'comments': self.comments,
'description': self.description,
'weight': float(self.weight) if self.weight is not None else None,
'weight_unit': self.weight_unit,
'comments': self.comments,
}

# Component templates
Expand Down

0 comments on commit 8bdbb49

Please sign in to comment.