Skip to content

Commit

Permalink
Workaround for bizarre issue #70
Browse files Browse the repository at this point in the history
Cannot reproduce locally -- could be an issue with Node 9 on Ubuntu 16 only.
  • Loading branch information
jhuckaby committed Jul 4, 2018
1 parent 70444c2 commit 228b6b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/storage-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ var ip = '';
var ifaces = os.networkInterfaces();
var addrs = [];
for (var key in ifaces) {
addrs = addrs.concat( addrs, ifaces[key] );
if (ifaces[key] && ifaces[key].length) {
Array.from(ifaces[key]).forEach( function(item) { addrs.push(item); } );
}
}
var addr = Tools.findObject( addrs, { family: 'IPv4', internal: false } );
if (addr && addr.address && addr.address.match(/^\d+\.\d+\.\d+\.\d+$/)) {
Expand Down
4 changes: 3 additions & 1 deletion lib/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ module.exports = Class.create({
var ifaces = os.networkInterfaces();
var addrs = [];
for (var key in ifaces) {
addrs = addrs.concat( addrs, ifaces[key] );
if (ifaces[key] && ifaces[key].length) {
Array.from(ifaces[key]).forEach( function(item) { addrs.push(item); } );
}
}
var addr = Tools.findObject( addrs, { family: 'IPv4', internal: false } );
if (addr && addr.address && addr.address.match(/^\d+\.\d+\.\d+\.\d+$/) && addr.netmask && addr.netmask.match(/^\d+\.\d+\.\d+\.\d+$/)) {
Expand Down

0 comments on commit 228b6b3

Please sign in to comment.