Skip to content

Commit c034caf

Browse files
committed
[airos] specify both location and mantainer from netjson
1 parent 486fdc6 commit c034caf

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

docs/source/backends/airos.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ JSON method
5656
General settings
5757
----------------
5858

59+
From the ``general`` key we can configure the contact and the location for a device using the ``contact`` and ``location`` properties.
60+
61+
The following snippet specify both contact and location:
62+
63+
.. code-block:: json
64+
65+
{
66+
"type": "DeviceConfiguration",
67+
"general": {
68+
"contact": "user@example.com",
69+
"location": "Up in the roof"
70+
}
71+
}
72+
5973
Network interface
6074
-----------------
6175

netjsonconfig/backends/airos/converters.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,13 @@ class Snmp(AirOsConverter):
489489
netjson_key = 'general'
490490

491491
def to_intermediate(self):
492+
original = get_copy(self.netson, self.netjson_key)
492493
result = [
493-
{
494-
'community': 'public',
495-
'contact': '',
496-
'location': '',
497-
'status': 'enabled',
494+
{
495+
'community': 'public',
496+
'contact': original.get('mantainer', ''),
497+
'location': original.get('location', ''),
498+
'status': 'enabled',
498499
},
499500
]
500501
return (('snmp', result),)

0 commit comments

Comments
 (0)