Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

list boxes

  • Loading branch information...
commit d37a706ad11df4f587cbfcfa7db0c9855be7c715 1 parent 16c2035
Patrick Debois jedi4ever authored
2  Gemfile.lock
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- veewee (0.1.2)
+ veewee (0.1.3)
highline (~> 1.6.1)
net-ssh (~> 2.1.0)
popen4 (~> 0.1.2)
2  iso/.gitignore
View
@@ -1,2 +0,0 @@
-*
-!.gitignore
15 lib/veewee/command.rb
View
@@ -21,17 +21,22 @@ module Veewee
class Command < Vagrant::Command::GroupBase
register "basebox","Commands to manage baseboxes"
- desc "templates", "List the currently available box templates"
+ desc "templates", "List the currently available basebox templates"
def templates
Veewee::Session.list_templates
end
- desc "define BOXNAME TEMPLATE", "Define a new box starting from a template"
+ desc "define BOXNAME TEMPLATE", "Define a new basebox starting from a template"
method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "overwrite the definition"
def define(boxname, template)
Veewee::Session.define(boxname,template,options)
end
+ desc "undefine BOXNAME", "Removes the definition of a basebox "
+ def undefine(boxname)
+ Veewee::Session.undefine(boxname)
+ end
+
desc "build BOXNAME", "Build the box BOXNAME"
method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "overwrite the basebox"
def build(boxname)
@@ -43,17 +48,17 @@ def ostypes
Veewee::Session.list_ostypes
end
- desc "destroy BOXNAME", "Destroy the virtualmachine of a basebox"
+ desc "destroy BOXNAME", "Destroys the virtualmachine that was build for a basebox"
def destroy(boxname)
puts Veewee::Session.destroy_vm(boxname)
end
- desc "list", "Lists all defined boxes"
+ desc "list", "Lists all defined baseboxes"
def list
Veewee::Session.list_definitions
end
- desc "export [NAME]", "export the box"
+ desc "export [NAME]", "Exports the basebox to the vagrant box format"
method_options :force => :boolean
def export(boxname)
if (!boxname.nil?)
21 lib/veewee/session.rb
View
@@ -100,6 +100,7 @@ def self.undefine(boxname)
name_dir=File.join(@definition_dir,boxname)
if File.directory?(name_dir)
#TODO: Needs to be more defensive!!
+ puts "Removing definition #{boxname}"
FileUtils.rm_rf(name_dir)
else
puts "Can not undefine , definition #{boxname} does not exist"
@@ -131,7 +132,11 @@ def self.list_boxes
end
def self.list_definitions
- puts "Not yet implemented"
+ puts "The following defined baseboxes exit:"
+ subdirs=Dir.glob("#{@definition_dir}/*")
+ subdirs.each do |sub|
+ puts "- "+File.basename(sub)
+ end
end
def self.clean
@@ -156,6 +161,11 @@ def self.verify_iso(filename,autodownload = false)
question=ask("Download? (Yes/No)") {|q| q.default="No"}
if question.downcase == "yes"
+ if !File.exists?(@iso_dir)
+ puts "Creating an iso directory"
+ FileUtils.mkdir(@iso_dir)
+ end
+
download_progress(@definition[:iso_src],full_path)
else
puts "You have choosen for manual download: "
@@ -175,6 +185,10 @@ def self.export_box(boxname)
load_definition(boxname)
Veewee::Export.vagrant(boxname,@box_dir,@definition)
+ #vagrant removes the mapping
+ #we need to restore it in order to be able to login again
+ add_ssh_nat_mapping(boxname)
+
end
def self.remove_box(boxname)
@@ -637,7 +651,7 @@ def self.transaction(boxname,step_name,checksums,&block)
#puts "remove old snapshots"
for s in (last_good_state+1)..(snapnames.length-1)
- puts "Removing step [s] snapshot as it is no more valid"
+ puts "Removing step [#{s}] snapshot as it is no more valid"
snapshot=vm.find_snapshot(snapnames[s])
snapshot.destroy
#puts snapshot
@@ -651,7 +665,8 @@ def self.transaction(boxname,step_name,checksums,&block)
sleep 2
#TODO:Restore snapshot!!!
vm.start
-
+ sleep 2
+ puts "Starting machine"
end
#puts "last good state #{last_good_state}"
2  lib/veewee/ssh.rb
View
@@ -8,7 +8,7 @@ def self.when_ssh_login_works(ip="localhost", options = { } , &block)
options=defaults.merge(options)
puts
- puts "Trying ssh login with user #{options[:user]} to sshd on port => #{options[:port]}"
+ puts "Waiting for ssh login with user #{options[:user]} to sshd on port => #{options[:port]} to work"
begin
Timeout::timeout(options[:timeout]) do
2  lib/veewee/version.rb
View
@@ -1,3 +1,3 @@
module Veewee
- VERSION = "0.1.2"
+ VERSION = "0.1.3"
end
2  templates/CentOS-4.8-i386/postinstall.sh
View
@@ -33,7 +33,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
-sh /mnt/VBoxLinuxAdditions-x86.run
+sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
2  templates/CentOS-5.5-i386-netboot/postinstall.sh
View
@@ -33,7 +33,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
-sh /mnt/VBoxLinuxAdditions-x86.run
+sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
2  templates/CentOS-5.5-i386/postinstall.sh
View
@@ -33,7 +33,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
-sh /mnt/VBoxLinuxAdditions-x86.run
+sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
2  templates/ubuntu-10.04.1-server-i386/postinstall.sh
View
@@ -36,7 +36,7 @@ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
-sh /mnt/VBoxLinuxAdditions-x86.run
+sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm VBoxGuestAdditions_$VBOX_VERSION.iso
Please sign in to comment.
Something went wrong with that request. Please try again.