Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix definition of meshviewer_org / ffrgb #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions freifunk/map-backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ def meshviewer_org(self):
addresses = properties.get('addresses', [])
autoupdater = properties.get('autoupdater', "")
gateway = properties.get('gateway', False)
vpn = properties.get('vpn', False)

def fmt_time(d):
return d.strftime("%Y-%m-%d %H:%M:%S")
Expand All @@ -287,11 +286,7 @@ def fmt_time(d):
uptime = ''

obj = {
'location': {},
'firmware': {
'base': '-',
'release': '-'
},
'firmware': {},
'autoupdater': {
'enabled': (autoupdater != ""),
'branch': autoupdater
Expand All @@ -300,7 +295,7 @@ def fmt_time(d):
}

if 'contact' in properties:
obj['contact'] = properties['contact']
obj['owner'] = properties['contact']

if self.has_location():
obj['location'] = {
Expand All @@ -326,10 +321,11 @@ def fmt_time(d):
obj['uptime'] = uptime
obj['gateway_nexthop'] = '-'
obj['gateway'] = '-'
obj['gateway6'] = '-'
obj['node_id'] = re.sub('[:]', '', self.mac)
obj['mac'] = self.mac
obj['addresses'] = addresses
obj['site_code'] = community
obj['domain'] = community
obj['hostname'] = name

if '-' in firmware:
Expand All @@ -340,7 +336,6 @@ def fmt_time(d):
obj['firmware']['release'] = firmware

obj['model'] = model
obj['vpn'] = vpn

return obj

Expand Down Expand Up @@ -622,7 +617,7 @@ def render_meshviewer_org(nodes, links):
link.reverse.done = True

return {
'meta' : { 'timestamp': now_timestamp.isoformat() },
'timestamp': now_timestamp.isoformat(),
'nodes' : all_nodes,
'links' : all_links
}
Expand Down