use staticIp

This commit is contained in:
Girish Ramakrishnan 2016-09-07 20:51:51 -07:00
parent 8c72602c0f
commit 49b78bc3e2
3 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ AppStore.prototype.waitForCloudron = function (boxId) {
// check for ready state
if (!boxInfo || boxInfo.status !== 'ready') throw new Error('waitForCloudron: could not get cloudron status');
debug('Box created in %s minutes with IP:%s'.green, (new Date() - creationTime) / 60000, res.body.box.ip);
debug('Box created in %s minutes with IP:%s (static: %s)'.green, (new Date() - creationTime) / 60000, res.body.box.ip, res.body.box.staticIp);
// even if the cloudron sent heartbeat to appstore, doesn't mean we can contact the cloudron thanks to DO networking insanity
process.stdout.write('Waiting for Cloudron to be reachable.');

View File

@ -449,7 +449,7 @@ Cloudron.prototype.checkA = function (callback) {
if (error) return callback(error);
if (records.length !== 1) return callback(new Error('Got ' + JSON.stringify(records) + ' A records. Expecting 1 length array'));
if (records[0] !== that._box.ip) return callback(new Error('Bad A record. ' + records[0] + '. Expecting ' + that._box.ip));
if (records[0] !== that._box.staticIp) return callback(new Error('Bad A record. ' + records[0] + '. Expecting ' + that._box.staticIp));
callback(null, records);
});

View File

@ -155,9 +155,9 @@ describe('Cloudron backup testing', function () {
it('wait for local dns', function () {
for (var i = 0; i < 50; i++) {
var ip = dnsSync.resolve(box.domain);
if (ip === box.ip) return;
if (ip === box.staticIp) return;
console.log('waiting for local dns to change from %s to %s', ip, box.ip);
console.log('waiting for local dns to change from %s to %s', ip, box.staticIp);
sleep(30);
}
});