Navigation Menu

Skip to content

Commit

Permalink
check if box exist or is running for up and validate command
Browse files Browse the repository at this point in the history
  • Loading branch information
jedi4ever committed Apr 16, 2012
1 parent 90720e4 commit 73bb765
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/veewee/provider/virtualbox/box/up.rb
Expand Up @@ -4,6 +4,12 @@ module Virtualbox
module BoxCommand

def up(options={})

unless self.exists?
env.ui.error "Error:: You tried to up a non-existing box '#{name}'"
exit -1
end

gui_enabled=options[:nogui]==true ? false : true

raise Veewee::Error,"Box is already running" if self.running?
Expand All @@ -21,7 +27,7 @@ def up(options={})
self.add_ssh_nat_mapping
end
else
self.add_ssh_nat_mapping
self.add_ssh_nat_mapping
end

self.suppress_messages
Expand Down
6 changes: 6 additions & 0 deletions lib/veewee/provider/virtualbox/box/validate_vagrant.rb
Expand Up @@ -4,6 +4,12 @@ module Virtualbox
module BoxCommand

def validate_vagrant(options)

unless self.running?
env.ui.error "Error:: You tried to validate box '#{name}' but it is not running"
exit -1
end

require 'cucumber'

require 'cucumber/rspec/disable_option_parser'
Expand Down

0 comments on commit 73bb765

Please sign in to comment.