From eef3bba12346b8cc2b579322d5ff32c6dd04b2ad Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 8 Aug 2017 13:50:03 +0200 Subject: [PATCH] gluon-client-bridge: use new gluon.site library to avoid 'or {}' syntax --- .../lib/gluon/upgrade/310-gluon-client-bridge-local-node | 6 +++--- .../luasrc/usr/lib/lua/gluon/client_bridge.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node index 47b86481..824d8d40 100755 --- a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node +++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node @@ -1,13 +1,13 @@ #!/usr/bin/lua local client_bridge = require 'gluon.client_bridge' -local site = require 'gluon.site_config' +local site = require 'gluon.site' local sysconfig = require 'gluon.sysconfig' local uci = require('simple-uci').cursor() -local next_node = site.next_node or {} +local next_node = site.next_node({}) uci:delete('network', 'local_node_dev') @@ -23,7 +23,7 @@ uci:section('network', 'device', 'local_node_dev', { local ip4, ip6 if next_node.ip4 then - local plen = site.prefix4:match('/%d+$') + local plen = site.prefix4():match('/%d+$') ip4 = next_node.ip4 .. plen end diff --git a/package/gluon-client-bridge/luasrc/usr/lib/lua/gluon/client_bridge.lua b/package/gluon-client-bridge/luasrc/usr/lib/lua/gluon/client_bridge.lua index e1ad2737..f3af7504 100644 --- a/package/gluon-client-bridge/luasrc/usr/lib/lua/gluon/client_bridge.lua +++ b/package/gluon-client-bridge/luasrc/usr/lib/lua/gluon/client_bridge.lua @@ -1,8 +1,8 @@ -local site = require 'gluon.site_config' +local site = require 'gluon.site' module 'gluon.client_bridge' function next_node_macaddr() - return (site.next_node or {}).mac or '16:41:95:40:f7:dc' + return site.next_node.mac('16:41:95:40:f7:dc') end