Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ebertech/virtualbox-guestcontrol
base: 98911ba7e6
...
head fork: ebertech/virtualbox-guestcontrol
compare: 7ccfa194ff
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
37 lib/virtualbox/guest_control/machine.rb
@@ -52,7 +52,6 @@ def initialize(name, uuid)
before_transition any => :running do |machine, transition|
Shellter.run!(machine.vbox_manage, "startvm", ":name", :name => machine.name)
machine.wait_until { machine.running? }
- machine.wait_until { machine.guest_additions_started? }
end
before_transition :running => :poweroff do |machine, transition|
@@ -91,6 +90,17 @@ def execute(*arguments)
end
end
+ state :starting do
+ def status
+ "Starting Up"
+ end
+
+ def execute(*arguments)
+ wait_until { running? }
+ execute(*arguments)
+ end
+ end
+
state :running do
def status
"Running"
@@ -155,7 +165,16 @@ def wait_until
end
def state
- environment[:VMState]
+ state_name = environment[:VMState]
+ if state_name == "running"
+ if guest_additions_started?
+ state_name
+ else
+ "starting"
+ end
+ else
+ state_name
+ end
end
def guest_additions_started?
@@ -183,12 +202,16 @@ def restart!
def environment
- result = Shellter.run!(vbox_manage, "showvminfo", ":name", "--machinereadable", :name => name)
- {}.with_indifferent_access.tap do |map|
- result.stdout.read.lines.each do |line|
- name, value = line.strip.split("=").map { |y| y.gsub(/(^"|"$)/, "") }
- map[name] = value
+ begin
+ result = Shellter.run!(vbox_manage, "showvminfo", ":name", "--machinereadable", :name => name)
+ {}.with_indifferent_access.tap do |map|
+ result.stdout.read.lines.each do |line|
+ name, value = line.strip.split("=").map { |y| y.gsub(/(^"|"$)/, "") }
+ map[name] = value
+ end
end
+ rescue
+ {}
end
end
View
2  lib/virtualbox/guest_control/version.rb
@@ -1,5 +1,5 @@
module VirtualBox
module GuestControl
- VERSION = "1.1"
+ VERSION = "1.1.1"
end
end

No commit comments for this range

Something went wrong with that request. Please try again.