From 51fb645e07b0bd2b567fd44e465acdfc958d817a Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 25 Jun 2014 12:47:05 -0700 Subject: ensure that monitor key directories exist before trying to generate the monitor ssh keys --- lib/leap_cli/commands/compile.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb index e96cb6a..63c2047 100644 --- a/lib/leap_cli/commands/compile.rb +++ b/lib/leap_cli/commands/compile.rb @@ -50,14 +50,16 @@ module LeapCli # keys, and every monitor node has a copy of the private monitor key. # def generate_monitor_ssh_keys - priv_key_file = :monitor_priv_key - pub_key_file = :monitor_pub_key + priv_key_file = path(:monitor_priv_key) + pub_key_file = path(:monitor_pub_key) unless file_exists?(priv_key_file, pub_key_file) - cmd = %(ssh-keygen -N '' -C 'monitor' -t ecdsa -b 521 -f '%s') % path(priv_key_file) + ensure_dir(File.dirname(priv_key_file)) + ensure_dir(File.dirname(pub_key_file)) + cmd = %(ssh-keygen -N '' -C 'monitor' -t ecdsa -b 521 -f '%s') % priv_key_file assert_run! cmd if file_exists?(priv_key_file, pub_key_file) - log :created, path(priv_key_file) - log :created, path(pub_key_file) + log :created, priv_key_file + log :created, pub_key_file else log :failed, 'to create monitor ssh keys' end -- cgit v1.2.3 From 98bd8c88c2cff5b267bf2d125ef4515ec241954f Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 25 Jun 2014 12:48:04 -0700 Subject: allow file(x, :missing => '') macro to report the path of x in the missing text. --- lib/leap_cli/config/object.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/leap_cli/config/object.rb b/lib/leap_cli/config/object.rb index 3375c6a..2392d1c 100644 --- a/lib/leap_cli/config/object.rb +++ b/lib/leap_cli/config/object.rb @@ -261,7 +261,7 @@ module LeapCli rescue FileMissing => exc Util::bail! do if exc.options[:missing] - Util::log :missing, exc.options[:missing].gsub('$node', self.name) + Util::log :missing, exc.options[:missing].gsub('$node', self.name).gsub('$file', exc.path) else Util::log :error, "while evaluating node '#{self.name}'" Util::log "offending key: #{key}", :indent => 1 -- cgit v1.2.3 From efe3a57f7d4ef845b7029d477454a18fd0e3dc41 Mon Sep 17 00:00:00 2001 From: KwadroNaut Date: Sat, 1 Nov 2014 00:49:14 +0100 Subject: update basebox url closes #5468 By using 'wheezy' instead of Debian in the url and box name, this is less confusing. At the same time, this makes it easier to support jessie boxes in the near future. The subdirectory virtualbox is to differentiate with the libvirt ones. --- lib/leap_cli/commands/vagrant.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/leap_cli/commands/vagrant.rb b/lib/leap_cli/commands/vagrant.rb index 24310e2..5219161 100644 --- a/lib/leap_cli/commands/vagrant.rb +++ b/lib/leap_cli/commands/vagrant.rb @@ -156,7 +156,7 @@ module LeapCli; module Commands if node.vagrant? lines << %[ config.vm.define :#{node.name} do |config|] lines << %[ config.vm.box = "leap-wheezy"] - lines << %[ config.vm.box_url = "https://downloads.leap.se/platform/leap-debian.box"] + lines << %[ config.vm.box_url = "https://downloads.leap.se/platform/vagrant/virtualbox/leap-wheezy.box"] lines << %[ config.vm.network :hostonly, "#{node.ip_address}", :netmask => "#{netmask}"] lines << %[ config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]] lines << %[ config.vm.customize ["modifyvm", :id, "--name", "#{node.name}"]] @@ -170,7 +170,7 @@ module LeapCli; module Commands if node.vagrant? lines << %[ config.vm.define :#{node.name} do |config|] lines << %[ config.vm.box = "leap-wheezy"] - lines << %[ config.vm.box_url = "https://downloads.leap.se/platform/leap-debian.box"] + lines << %[ config.vm.box_url = "https://downloads.leap.se/platform/vagrant/virtualbox/leap-wheezy.box"] lines << %[ config.vm.network :private_network, ip: "#{node.ip_address}"] lines << %[ config.vm.provider "virtualbox" do |v|] lines << %[ v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]] -- cgit v1.2.3