From 1350254bfab0acec157dcffd89af26820d6acaef Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel Date: Thu, 9 Aug 2012 12:51:14 -0600 Subject: [PATCH] hardcode awsbox into deployment names everywhere for consistency --- awsbox.js | 14 +++++++------- lib/vm.js | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/awsbox.js b/awsbox.js index 57c7310..a72afde 100755 --- a/awsbox.js +++ b/awsbox.js @@ -70,7 +70,7 @@ verbs['destroy'] = function(args) { var fqdn = fqdns.shift(); process.stdout.write("deleting " + fqdn + ": "); dns.deleteRecord(dnsKey, fqdn, function(err) { - console.log(err ? "failed: " + err : "done"); + console.log(err ? "failed: " + err : "done"); removeNext(); }); } @@ -87,13 +87,13 @@ verbs['test'] = function() { process.stdout.write("Checking AWS access: "); vm.list(function(err) { console.log(err ? "NOT ok: " + err : "good"); - + if (process.env['ZERIGO_DNS_KEY']) { process.stdout.write("Checking DNS access: "); dns.inUse(process.env['ZERIGO_DNS_KEY'], 'example.com', function(err, res) { - console.log(err ? "NOT ok: " + err : "good"); + console.log(err ? "NOT ok: " + err : "good"); }); - } + } }); } @@ -158,11 +158,11 @@ verbs['create'] = function(args) { var name = opts.n || "noname"; validateName(name); var hostname = name; - var longName = process.env['USER'] + "'s " + process.title + ' deployment (' + name + ')'; + var longName = process.env['USER'] + "'s awsbox deployment (" + name + ')'; console.log("reading .awsbox.json"); - try { + try { var awsboxJson = JSON.parse(fs.readFileSync("./.awsbox.json")); } catch(e) { checkErr("Can't read awsbox.json: " + e); @@ -178,7 +178,7 @@ verbs['create'] = function(args) { dnsKey = process.env['ZERIGO_DNS_KEY']; dnsHost = urlparse(opts.u).host; if (opts.dnscheck) { - console.log(" ... Checking for DNS availability of " + dnsHost); + console.log(" ... Checking for DNS availability of " + dnsHost); } } diff --git a/lib/vm.js b/lib/vm.js index fecb3fa..d013422 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -55,7 +55,7 @@ exports.list = function(cb) { }); }; -// given something the user typed in, try to figure out what instance they're talking about +// given something the user typed in, try to figure out what instance they're talking about function findInstance(r, name) { // is what the human typed in an instance id? var x = jsel.match("object:has(:root > .instanceId:val(?))", [ name ], r); @@ -90,15 +90,15 @@ exports.destroy = function(name, cb) { }; function dateBasedVersion() { - var d = new Date(); + var d = new Date(); function pad(n){return n<10 ? '0'+n : n} - return d.getUTCFullYear()+'.' - + pad(d.getUTCMonth()+1)+'.' - + pad(d.getUTCDate())+'-' - + pad(d.getUTCHours())+'.' - + pad(d.getUTCMinutes()); -} - + return d.getUTCFullYear()+'.' + + pad(d.getUTCMonth()+1)+'.' + + pad(d.getUTCDate())+'-' + + pad(d.getUTCHours())+'.' + + pad(d.getUTCMinutes()); +} + exports.find = function(name, cb) { exports.list(function(err, r) { if (err) return cb('failed to list vms: ' + err);