Skip to content

Commit

Permalink
get own hostname in autoscale
Browse files Browse the repository at this point in the history
  • Loading branch information
seattlevine committed Jun 8, 2018
1 parent 1d458a0 commit fd8c068
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
Binary file modified dist/f5-cloud-libs.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/verifyHash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cli script /Common/verifyHash {
proc script::run {} {
if {[catch {
set hashes(f5-cloud-libs.tar.gz) afcd5165f47a538ace25374fdc26f8992fe6b7dbce00d8736dce95786ce0daa06cfce8ca3d8bb5116f291f01105d95e5aa96d5dcf624a568185c656113079298
set hashes(f5-cloud-libs.tar.gz) f4e30dd04f065daa2d9f0adab38a91d1164cd483783542da41f5a0cf017588580b352983e5283bf1cdc963cb20e6f6c84f76e84c0ce298aafbcd9256ba3e185d
set hashes(f5-cloud-libs-aws.tar.gz) e06f724ff1c7fc41d95ef87fc6f7a118d7e64d5555b5e9548ee7582bc3eb8d461ca72266a0758837a951ccd465876c877329fe8a47b38da5183c832680b76b93
set hashes(f5-cloud-libs-azure.tar.gz) f1a5e8cfc639063885b595282cb5befdaf88d51ef62bd26e3658e2f3f3b5bbbb2ce0ba54ec1cd12ba87a2336134588affe63052511f7c6c93fb7fc73b8a0e095
set hashes(f5-cloud-libs-gce.tar.gz) 66072a397912a2f64ef74f2bb3fcc51c2ca90002d7df67534cf1ace031251d0a2d08f5efb492fa3c46718c65fb24234d2c863dd457e1d300b41dd6f82aca9849
Expand Down
6 changes: 3 additions & 3 deletions lib/autoscaleProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ AutoscaleProvider.prototype.putInstance = function putInstance(instanceId, insta
*
* @abstract
*
* @param {String} actionId - Action id of message to send
* @param {String} action - Action id of message to send
* @param {Object} [options] - Optional parameters
* @param {String} [options.toInstanceId] - Instance ID that message is for
* @param {String} [options.fromInstanceId] - Instance ID that message is from
Expand All @@ -489,9 +489,9 @@ AutoscaleProvider.prototype.putInstance = function putInstance(instanceId, insta
* @returns {Promise} A promise which will be resolved when the message
* has been sent or rejected if an error occurs
*/
AutoscaleProvider.prototype.sendMessage = function sendMessage(actionId, data) {
AutoscaleProvider.prototype.sendMessage = function sendMessage(action, data) {
if (this.hasFeature(AutoscaleProvider.FEATURE_MESSAGING)) {
throw new Error('Unimplemented abstract method AutoscaleProvider.sendMessage', actionId, data);
throw new Error('Unimplemented abstract method AutoscaleProvider.sendMessage', action, data);
} else {
this.logger.debug('No override for AutoscaleProvider.sendMessage');
return q(true);
Expand Down
17 changes: 14 additions & 3 deletions scripts/autoscale.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,6 @@ const commonOptions = require('./commonOptions');
util.logAndExit('Currently becoming master. Exiting.', 'info');
}

return asProvider.putInstance(this.instanceId, this.instance);
})
.then(() => {
if (optionsForTest.bigIp) {
bigIp = optionsForTest.bigIp;
return q();
Expand All @@ -334,6 +331,20 @@ const commonOptions = require('./commonOptions');
}
);
})
.then(() => {
// Make sure we have our own hostname
if (!this.instance.hostname) {
return bigIp.list('/tm/sys/global-settings');
}
return q();
})
.then((globalSettings) => {
if (globalSettings) {
this.instance.hostname = globalSettings.hostname;
}

return asProvider.putInstance(this.instanceId, this.instance);
})
.then(() => {
return asProvider.bigIpReady();
})
Expand Down

0 comments on commit fd8c068

Please sign in to comment.