api: Ensure Supervisor API returns IP addresses

The move from pure CoffeeScript to TypeScript has brought a
few changes to the way transpiling happens. Previously, through
serendipity, the way `startIPAddressUpdate` was called worked
because of the binding convention pre-transpiling.

However, with the move to TypeScript, this has altered and
the assumption that a lack of parentheses would call the
method before supplying a callback into the returned function
is incorrect. The method must be specifically called first.

Connects-to: #836
Change-type: patch
Signed-off-by: Heds Simons <heds@balena.io>
This commit is contained in:
Heds Simons 2018-12-06 16:17:57 +00:00
parent 2f71b70aaa
commit 80203f29ad
No known key found for this signature in database
GPG Key ID: 2A079CB76EC8B3D4

View File

@ -301,7 +301,7 @@ module.exports = class DeviceState extends EventEmitter
if changedConfig.connectivityCheckEnabled?
network.enableConnectivityCheck(changedConfig.connectivityCheckEnabled)
console.log('Starting periodic check for IP addresses')
network.startIPAddressUpdate (addresses) =>
network.startIPAddressUpdate() (addresses) =>
@reportCurrentState(
ip_address: addresses.join(' ')
)