Bugfix some stray machine args after tidy up (#1227)

Clean up the remaining references to the old functions after the
wait-till-up networking code tidy up.
This commit is contained in:
Darragh Bailey
2021-03-17 18:16:06 +00:00
committed by GitHub
parent bbbcdaa44b
commit 9f8912d7aa
3 changed files with 9 additions and 9 deletions

View File

@@ -21,7 +21,7 @@ module VagrantPlugins
env[:metrics] ||= {}
# Get domain object
domain = env[:machine].provider.driver.get_domain(env[:machine].id.to_s)
domain = env[:machine].provider.driver.get_domain
if domain.nil?
raise Errors::NoDomainError,
error_message: "Domain #{env[:machine].id} not found"

View File

@@ -75,14 +75,14 @@ module VagrantPlugins
domain
end
def created?(mid)
domain = get_domain(mid)
def created?
domain = get_domain
!domain.nil?
end
def get_ipaddress
# Find the machine
domain = get_domain(@machine.id)
domain = get_domain
if domain.nil?
# The machine can't be found
@@ -112,12 +112,12 @@ module VagrantPlugins
ip_address
end
def state(machine)
def state
# may be other error states with initial retreival we can't handle
begin
domain = get_domain(machine.id)
domain = get_domain
rescue Libvirt::RetrieveError => e
@logger.debug("Machine #{machine.id} not found #{e}.")
@logger.debug("Machine #{@machine.id} not found #{e}.")
return :not_created
end

View File

@@ -97,9 +97,9 @@ module VagrantPlugins
state_id = nil
state_id = :not_created unless @machine.id
state_id = :not_created if
!state_id && (!@machine.id || !driver.created?(@machine.id))
!state_id && (!@machine.id || !driver.created?)
# Query the driver for the current state of the machine
state_id = driver.state(@machine) if @machine.id && !state_id
state_id = driver.state if @machine.id && !state_id
state_id = :unknown unless state_id
# This is a special pseudo-state so that we don't set the