From 99570254b09fbcbc13309f6d329a15fe478547d1 Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel Date: Mon, 11 Jun 2012 15:00:08 +0300 Subject: [PATCH] --dnscheck flag --- ChangeLog | 3 +++ awsbox.js | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c91623..fbfd96f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +0.2.9 - + * add a --dnscheck flag to create to disable dns check prior to VM creation + 0.2.8 - * fix /ver.txt serving over SSL diff --git a/awsbox.js b/awsbox.js index 452a96d..6f096f9 100755 --- a/awsbox.js +++ b/awsbox.js @@ -107,6 +107,9 @@ verbs['create'] = function(args) { var parser = optimist(args) .usage('awsbox create: Create a VM') .describe('d', 'setup DNS via zerigo (requires ZERIGO_DNS_KEY in env)') + .describe('dnscheck', 'whether to check for existing DNS records') + .boolean('dnscheck') + .default('dnscheck', true) .describe('n', 'a short nickname for the VM.') .describe('u', 'publically visible URL for the instance') .describe('remote', 'add a git remote') @@ -174,12 +177,16 @@ verbs['create'] = function(args) { if (!process.env['ZERIGO_DNS_KEY']) checkErr('-d requires ZERIGO_DNS_KEY env var'); dnsKey = process.env['ZERIGO_DNS_KEY']; dnsHost = urlparse(opts.u).host; - console.log(" ... Checking for DNS availability of " + dnsHost); + if (opts.dnscheck) { + console.log(" ... Checking for DNS availability of " + dnsHost); + } } dns.inUse(dnsKey, dnsHost, function(err, res) { checkErr(err); - if (res) checkErr('that domain is in use, pointing at ' + res.data); + if (res && opts.dnscheck) { + checkErr('that domain is in use, pointing at ' + res.data); + } vm.startImage({ type: opts.t