make sysinfo provider a setting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getPublicIp: getPublicIp
|
||||
getServerIp: getServerIp
|
||||
};
|
||||
|
||||
var assert = require('assert'),
|
||||
@@ -9,7 +9,8 @@ var assert = require('assert'),
|
||||
superagent = require('superagent'),
|
||||
util = require('util');
|
||||
|
||||
function getPublicIp(callback) {
|
||||
function getServerIp(config, callback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
superagent.get('http://169.254.169.254/latest/meta-data/public-ipv4').timeout(30 * 1000).end(function (error, result) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getPublicIp: getPublicIp
|
||||
getServerIp: getServerIp
|
||||
};
|
||||
|
||||
var assert = require('assert'),
|
||||
@@ -9,7 +9,8 @@ var assert = require('assert'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
superagent = require('superagent');
|
||||
|
||||
function getPublicIp(callback) {
|
||||
function getServerIp(config, callback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
if (process.env.BOX_ENV === 'test') return callback(null, '127.0.0.1');
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
// -------------------------------------------
|
||||
|
||||
exports = module.exports = {
|
||||
getPublicIp: getPublicIp
|
||||
getServerIp: getServerIp
|
||||
};
|
||||
|
||||
var assert = require('assert');
|
||||
|
||||
function getPublicIp(callback) {
|
||||
function getServerIp(config, callback) {
|
||||
assert.strictEqual(typeo config, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
callback(new Error('not implemented'));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getPublicIp: getPublicIp
|
||||
getServerIp: getServerIp
|
||||
};
|
||||
|
||||
var assert = require('assert'),
|
||||
@@ -9,7 +9,8 @@ var assert = require('assert'),
|
||||
superagent = require('superagent'),
|
||||
util = require('util');
|
||||
|
||||
function getPublicIp(callback) {
|
||||
function getServerIp(config, callback) {
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
superagent.get('http://169.254.42.42/conf').timeout(30 * 1000).end(function (error, result) {
|
||||
|
||||
Reference in New Issue
Block a user