[DRE-commits] [vagrant-libvirt] 36/77: Merge branch 'read_state_fix' of github.com:keitwb/vagrant-libvirt

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:56:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag 0.0.17
in repository vagrant-libvirt.

commit 635038676467224e3e9b48e6565a98cca9209ffb
Merge: 372819e 62f767a
Author: dima <pronix.service at gmail.com>
Date:   Tue Apr 1 12:57:57 2014 +0200

    Merge branch 'read_state_fix' of github.com:keitwb/vagrant-libvirt
    
    Conflicts:
    	lib/vagrant-libvirt/action/read_state.rb

 lib/vagrant-libvirt/action/read_state.rb |  26 +++++---
 lib/vagrant-libvirt/util.rb              |   1 +
 lib/vagrant-libvirt/util/error_codes.rb  | 101 +++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+), 8 deletions(-)

diff --cc lib/vagrant-libvirt/action/read_state.rb
index 22d39c3,7e62fff..ad552a1
--- a/lib/vagrant-libvirt/action/read_state.rb
+++ b/lib/vagrant-libvirt/action/read_state.rb
@@@ -18,20 -18,24 +18,30 @@@ module VagrantPlugin
  
          def read_state(libvirt, machine)
            return :not_created if machine.id.nil?
-           
+ 
 +          begin
 +            server = libvirt.servers.get(machine.id)
 +          rescue Libvirt::RetrieveError => e
 +            server = nil
 +            @logger.debug('Machine not found #{e}.')
-           end 
++          end
            # Find the machine
-           
-           if server.nil? || [:'shutting-down', :terminated].include?(server.state.to_sym)
-             # The machine can't be found
-             @logger.info('Machine not found or terminated, assuming it got destroyed.')
-             machine.id = nil
-             return :not_created
+           begin
+             server = libvirt.servers.get(machine.id)
 -            if [:'shutting-down', :terminated].include?(server.state.to_sym)
++            if server.nil? || [:'shutting-down', :terminated].include?(server.state.to_sym)
+               # The machine can't be found
+               @logger.info('Machine shutting down or terminated, assuming it got destroyed.')
+               machine.id = nil
+               return :not_created
+             end
+           rescue Libvirt::RetrieveError => e
+             if e.libvirt_code == ProviderLibvirt::Util::ErrorCodes::VIR_ERR_NO_DOMAIN
+               @logger.info("Machine #{machine.id} not found.")
+               machine.id = nil
+               return :not_created
+             else
+               raise e
+             end
            end
  
            # Return the state

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git



More information about the Pkg-ruby-extras-commits mailing list