Browse Source

get back merge() for nodeinfo

Karsten Böddeker 7 years ago
parent
commit
d5014cfca9
2 changed files with 4 additions and 19 deletions
  1. 2 1
      config.json.example
  2. 2 18
      ext-respondd.py

+ 2 - 1
config.json.example

@@ -23,6 +23,7 @@
     },
     "system": {
       "site_code": "ffho"
-    }
+    },
+	"vpn": true
   }
 }

+ 2 - 18
ext-respondd.py

@@ -301,6 +301,7 @@ def createNodeinfo():
         "hostname": socket.gethostname(),
         "network": {
             "addresses": getDevice_Addresses(config['bridge']),
+            "mac": getDevice_MAC(config['batman'])
             "mesh": {
                 "bat0": {
                     "interfaces": getBat0_Interfaces(),
@@ -340,25 +341,8 @@ def createNodeinfo():
             "version": call(['fastd','-v'])[0].split(' ')[1],
             "enabled": True,
         },
-        j['vpn'] = True
 
-    if 'network' in config['nodeinfo'] and 'mac' in config['nodeinfo']['network']:
-        j['network']['mac'] = config['nodeinfo']['network']['mac']
-    else:
-        j['network']['mac'] = getDevice_MAC(config['batman'])
-
-    if 'location' in config['nodeinfo']:
-        j['location'] = {
-            "latitude": config['nodeinfo']['location']['latitude'],
-            "longitude": config['nodeinfo']['location']['longitude'],
-        }
-
-    if 'owner' in config['nodeinfo']:
-        j['owner'] = {
-            "contact": config['owner']['contact']
-        }
-
-    return j
+    return merge(j, config['nodeinfo'])
 
 def createStatistics():
     j = {