mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 11:26:41 +00:00
Fix issue where network settings were not used by config generate
Change-Type: patch
This commit is contained in:
parent
2a2d621d6a
commit
f7075d7db9
@ -18,10 +18,18 @@ limitations under the License.
|
||||
var authenticateWithApplicationKey, authenticateWithDeviceKey;
|
||||
|
||||
exports.generateBaseConfig = function(application, options) {
|
||||
var Promise, deviceConfig, resin;
|
||||
var Promise, _, deviceConfig, resin;
|
||||
Promise = require('bluebird');
|
||||
_ = require('lodash');
|
||||
deviceConfig = require('resin-device-config');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
options = _.mapValues(options, function(value, key) {
|
||||
if (key === 'appUpdatePollInterval') {
|
||||
return value * 60 * 1000;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
});
|
||||
return Promise.props({
|
||||
userId: resin.auth.getUserId(),
|
||||
username: resin.auth.whoami(),
|
||||
@ -48,12 +56,12 @@ exports.generateBaseConfig = function(application, options) {
|
||||
mixpanel: {
|
||||
token: results.mixpanelToken
|
||||
}
|
||||
});
|
||||
}, options);
|
||||
});
|
||||
};
|
||||
|
||||
exports.generateApplicationConfig = function(application, options) {
|
||||
return exports.generateBaseConfig(application).tap(function(config) {
|
||||
return exports.generateBaseConfig(application, options).tap(function(config) {
|
||||
return authenticateWithApplicationKey(config, application.id);
|
||||
});
|
||||
};
|
||||
|
@ -16,9 +16,16 @@ limitations under the License.
|
||||
|
||||
exports.generateBaseConfig = (application, options) ->
|
||||
Promise = require('bluebird')
|
||||
_ = require('lodash')
|
||||
deviceConfig = require('resin-device-config')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
options = _.mapValues options, (value, key) ->
|
||||
if key == 'appUpdatePollInterval'
|
||||
value * 60 * 1000
|
||||
else
|
||||
value
|
||||
|
||||
Promise.props
|
||||
userId: resin.auth.getUserId()
|
||||
username: resin.auth.whoami()
|
||||
@ -42,9 +49,10 @@ exports.generateBaseConfig = (application, options) ->
|
||||
pubnub: results.pubNubKeys
|
||||
mixpanel:
|
||||
token: results.mixpanelToken
|
||||
, options
|
||||
|
||||
exports.generateApplicationConfig = (application, options) ->
|
||||
exports.generateBaseConfig(application)
|
||||
exports.generateBaseConfig(application, options)
|
||||
.tap (config) ->
|
||||
authenticateWithApplicationKey(config, application.id)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user