Handling the cases for UNSET_VALUE, i.e., config is not finalized.
This commit is contained in:
parent
d2c11e81ae
commit
281203edf1
|
@ -25,9 +25,10 @@ module VagrantPlugins
|
||||||
# The objective here is to get pip either by default
|
# The objective here is to get pip either by default
|
||||||
# or by the argument passed in. The objective is not
|
# or by the argument passed in. The objective is not
|
||||||
# to circumvent the pip setup by passing in nothing.
|
# to circumvent the pip setup by passing in nothing.
|
||||||
# Thus, we stick with the default on an empty string.
|
# Thus, we stick with the default on an empty string
|
||||||
|
# or if it is an UNSET_VALUE.
|
||||||
|
|
||||||
if pip_install_cmd.empty?
|
if pip_install_cmd == Vagrant.plugin("2", :config)::UNSET_VALUE || pip_install_cmd.empty?
|
||||||
pip_install_cmd=DEFAULT_PIP_INSTALL_CMD
|
pip_install_cmd=DEFAULT_PIP_INSTALL_CMD
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,11 @@ describe VagrantPlugins::Ansible::Cap::Guest::Pip do
|
||||||
expect(communicator).to receive(:execute).with("curl https://bootstrap.pypa.io/get-pip.py | sudo python")
|
expect(communicator).to receive(:execute).with("curl https://bootstrap.pypa.io/get-pip.py | sudo python")
|
||||||
subject.get_pip(machine,pip_install_command)
|
subject.get_pip(machine,pip_install_command)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "installs pip using the default command if the argument is UNSET_VALUE" do
|
||||||
|
expect(communicator).to receive(:execute).with("curl https://bootstrap.pypa.io/get-pip.py | sudo python")
|
||||||
|
subject.get_pip(machine, Vagrant.plugin("2", :config)::UNSET_VALUE)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue