Only check for staticIp for custom domain cloudrons

This commit is contained in:
Johannes Zellner 2016-09-09 11:54:40 +02:00
parent 12a9eda3cf
commit 29dcc97da3
2 changed files with 6 additions and 2 deletions

View File

@ -97,11 +97,13 @@ AppStore.prototype.waitForCloudron = function (boxId) {
}
}
if (!boxInfo) throw new Error('waitForCloudron: could not get cloudron information');
// check for static ip
if (!boxInfo || !boxInfo.staticIp) throw new Error('waitForCloudron: could not get cloudron static ip');
if (boxInfo.isCustomDomain && !boxInfo.staticIp) throw new Error('waitForCloudron: could not get cloudron static ip');
// check for ready state
if (!boxInfo || boxInfo.status !== 'ready') throw new Error('waitForCloudron: could not get cloudron status');
if (boxInfo.status !== 'ready') throw new Error('waitForCloudron: could not get cloudron status');
debug('Box created in %s minutes with IP:%s (static: %s)'.green, (new Date() - creationTime) / 60000, res.body.box.ip, res.body.box.staticIp);

View File

@ -271,6 +271,8 @@ describe('Selfhost EC2 Cloudron creation', function () {
// we ignore errors here
function deleteDroplet(id, callback) {
if (!id) return callback();
superagent.del('https://api.digitalocean.com/v2/droplets/' + id).set('Authorization', 'Bearer ' + DO_TOKEN).end(function (error, result) {
if (error) console.error(error.message);
if (result.statusCode !== 204) console.error('Failed to cleanup old droplet. %s %j', result.statusCode, result.body);