diff --git a/plugins/provisioners/ansible/cap/guest/pip/pip.rb b/plugins/provisioners/ansible/cap/guest/pip/pip.rb index 307261a7f..df22cf181 100644 --- a/plugins/provisioners/ansible/cap/guest/pip/pip.rb +++ b/plugins/provisioners/ansible/cap/guest/pip/pip.rb @@ -25,9 +25,10 @@ module VagrantPlugins # The objective here is to get pip either by default # or by the argument passed in. The objective is not # 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 end diff --git a/test/unit/plugins/provisioners/ansible/cap/guest/pip/pip_test.rb b/test/unit/plugins/provisioners/ansible/cap/guest/pip/pip_test.rb index 24f510186..da4b25460 100644 --- a/test/unit/plugins/provisioners/ansible/cap/guest/pip/pip_test.rb +++ b/test/unit/plugins/provisioners/ansible/cap/guest/pip/pip_test.rb @@ -41,7 +41,12 @@ describe VagrantPlugins::Ansible::Cap::Guest::Pip do pip_install_command = "" expect(communicator).to receive(:execute).with("curl https://bootstrap.pypa.io/get-pip.py | sudo python") 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 \ No newline at end of file