aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/leap_cli/commands/vagrant.rb7
-rw-r--r--lib/leap_cli/config/node.rb2
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/leap_cli/commands/vagrant.rb b/lib/leap_cli/commands/vagrant.rb
index 8e1ffc6..5aeed74 100644
--- a/lib/leap_cli/commands/vagrant.rb
+++ b/lib/leap_cli/commands/vagrant.rb
@@ -82,7 +82,6 @@ module LeapCli; module Commands
def vagrant_command(cmds, args)
vagrant_setup
cmds = cmds.to_a
- assert_config! 'provider.vagrant.network'
if args.empty?
nodes = [""]
else
@@ -98,7 +97,7 @@ module LeapCli; module Commands
end
execute exec.join('; ')
else
- bail! "No nodes found. This command only works on nodes with ip_address in the network #{provider.vagrant.network}"
+ bail! "No nodes found. This command only works on nodes with ip_address in the network #{LeapCli.leapfile.vagrant_network}"
end
end
@@ -120,7 +119,7 @@ module LeapCli; module Commands
def create_vagrant_file
lines = []
- netmask = IPAddr.new('255.255.255.255').mask(provider.vagrant.network.split('/').last).to_s
+ netmask = IPAddr.new('255.255.255.255').mask(LeapCli.leapfile.vagrant_network.split('/').last).to_s
lines << %[Vagrant::Config.run do |config|]
manager.each_node do |node|
if node.vagrant?
@@ -144,7 +143,7 @@ module LeapCli; module Commands
highest_ip = taken_ips.map{|ip| IPAddr.new(ip)}.max
new_ip = highest_ip.succ
else
- new_ip = IPAddr.new(provider.vagrant.network).succ.succ
+ new_ip = IPAddr.new(LeapCli.leapfile.vagrant_network).succ.succ
end
return new_ip.to_s
end
diff --git a/lib/leap_cli/config/node.rb b/lib/leap_cli/config/node.rb
index 9eea1f3..15a2d3d 100644
--- a/lib/leap_cli/config/node.rb
+++ b/lib/leap_cli/config/node.rb
@@ -35,7 +35,7 @@ module LeapCli; module Config
#
def vagrant?
begin
- vagrant_range = IPAddr.new @manager.provider.vagrant.network
+ vagrant_range = IPAddr.new LeapCli.leapfile.vagrant_network
rescue ArgumentError => exc
Util::bail! { Util::log :invalid, "ip address '#{@node.ip_address}' vagrant.network" }
end