providers/*: use special NOT_CREATED_ID if not created
This commit is contained in:
parent
45fc89877c
commit
a34ee404d8
|
@ -146,12 +146,14 @@ module VagrantPlugins
|
|||
state_id = driver.state(@machine.id) if @machine.id && !state_id
|
||||
state_id = :unknown if !state_id
|
||||
|
||||
# If the machine is not created, make sure to clear out machine ID
|
||||
@machine.id = nil if state_id == :not_created
|
||||
|
||||
short = state_id.to_s.gsub("_", " ")
|
||||
long = I18n.t("docker_provider.status.#{state_id}")
|
||||
|
||||
# If we're not created, then specify the special ID flag
|
||||
if state_id == :not_created
|
||||
state_id = Vagrant::MachineState::NOT_CREATED_ID
|
||||
end
|
||||
|
||||
Vagrant::MachineState.new(state_id, short, long)
|
||||
end
|
||||
|
||||
|
|
|
@ -67,6 +67,11 @@ module VagrantPlugins
|
|||
short = state_id.to_s
|
||||
long = ""
|
||||
|
||||
# If we're not created, then specify the special ID flag
|
||||
if state_id == :not_created
|
||||
state_id = Vagrant::MachineState::NOT_CREATED_ID
|
||||
end
|
||||
|
||||
# Return the MachineState object
|
||||
Vagrant::MachineState.new(state_id, short, long)
|
||||
end
|
||||
|
|
|
@ -79,15 +79,15 @@ module VagrantPlugins
|
|||
state_id = @driver.read_state if !state_id
|
||||
state_id = :unknown if !state_id
|
||||
|
||||
# If we're not created, then reset the ID to nil
|
||||
if state_id == :not_created
|
||||
@machine.id = nil
|
||||
end
|
||||
|
||||
# Translate into short/long descriptions
|
||||
short = state_id.to_s.gsub("_", " ")
|
||||
long = I18n.t("vagrant.commands.status.#{state_id}")
|
||||
|
||||
# If we're not created, then specify the special ID flag
|
||||
if state_id == :not_created
|
||||
state_id = Vagrant::MachineState::NOT_CREATED_ID
|
||||
end
|
||||
|
||||
# Return the state
|
||||
Vagrant::MachineState.new(state_id, short, long)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue