vagrant-fixed-ssh 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +46 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +723 -0
- data/Gemfile +3 -0
- data/LICENSE +22 -0
- data/README.md +121 -0
- data/Rakefile +18 -0
- data/bin/vagrant +60 -0
- data/config/default.rb +30 -0
- data/contrib/README.md +12 -0
- data/contrib/emacs/vagrant.el +8 -0
- data/contrib/vim/vagrantfile.vim +9 -0
- data/keys/README.md +17 -0
- data/keys/vagrant +27 -0
- data/keys/vagrant.pub +1 -0
- data/lib/vagrant.rb +197 -0
- data/lib/vagrant/action.rb +63 -0
- data/lib/vagrant/action/box/destroy.rb +25 -0
- data/lib/vagrant/action/box/download.rb +84 -0
- data/lib/vagrant/action/box/package.rb +19 -0
- data/lib/vagrant/action/box/unpackage.rb +61 -0
- data/lib/vagrant/action/box/verify.rb +23 -0
- data/lib/vagrant/action/builder.rb +128 -0
- data/lib/vagrant/action/builtin.rb +171 -0
- data/lib/vagrant/action/env/set.rb +21 -0
- data/lib/vagrant/action/environment.rb +12 -0
- data/lib/vagrant/action/general/check_virtualbox.rb +28 -0
- data/lib/vagrant/action/general/package.rb +101 -0
- data/lib/vagrant/action/general/validate.rb +18 -0
- data/lib/vagrant/action/runner.rb +53 -0
- data/lib/vagrant/action/vm/boot.rb +53 -0
- data/lib/vagrant/action/vm/check_accessible.rb +23 -0
- data/lib/vagrant/action/vm/check_box.rb +33 -0
- data/lib/vagrant/action/vm/check_guest_additions.rb +38 -0
- data/lib/vagrant/action/vm/check_port_collisions.rb +89 -0
- data/lib/vagrant/action/vm/clean_machine_folder.rb +43 -0
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +18 -0
- data/lib/vagrant/action/vm/clear_network_interfaces.rb +31 -0
- data/lib/vagrant/action/vm/clear_shared_folders.rb +18 -0
- data/lib/vagrant/action/vm/customize.rb +36 -0
- data/lib/vagrant/action/vm/default_name.rb +22 -0
- data/lib/vagrant/action/vm/destroy.rb +19 -0
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +20 -0
- data/lib/vagrant/action/vm/discard_state.rb +22 -0
- data/lib/vagrant/action/vm/export.rb +57 -0
- data/lib/vagrant/action/vm/forward_ports.rb +92 -0
- data/lib/vagrant/action/vm/halt.rb +32 -0
- data/lib/vagrant/action/vm/host_name.rb +21 -0
- data/lib/vagrant/action/vm/import.rb +48 -0
- data/lib/vagrant/action/vm/match_mac_address.rb +21 -0
- data/lib/vagrant/action/vm/network.rb +403 -0
- data/lib/vagrant/action/vm/nfs.rb +196 -0
- data/lib/vagrant/action/vm/package.rb +23 -0
- data/lib/vagrant/action/vm/package_vagrantfile.rb +36 -0
- data/lib/vagrant/action/vm/provision.rb +61 -0
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +26 -0
- data/lib/vagrant/action/vm/prune_nfs_exports.rb +20 -0
- data/lib/vagrant/action/vm/resume.rb +20 -0
- data/lib/vagrant/action/vm/sane_defaults.rb +78 -0
- data/lib/vagrant/action/vm/setup_package_files.rb +54 -0
- data/lib/vagrant/action/vm/share_folders.rb +114 -0
- data/lib/vagrant/action/vm/suspend.rb +20 -0
- data/lib/vagrant/action/warden.rb +92 -0
- data/lib/vagrant/box.rb +44 -0
- data/lib/vagrant/box_collection.rb +58 -0
- data/lib/vagrant/cli.rb +76 -0
- data/lib/vagrant/command.rb +24 -0
- data/lib/vagrant/command/base.rb +167 -0
- data/lib/vagrant/command/box.rb +58 -0
- data/lib/vagrant/command/box_add.rb +37 -0
- data/lib/vagrant/command/box_list.rb +28 -0
- data/lib/vagrant/command/box_remove.rb +27 -0
- data/lib/vagrant/command/box_repackage.rb +27 -0
- data/lib/vagrant/command/destroy.rb +64 -0
- data/lib/vagrant/command/gem.rb +39 -0
- data/lib/vagrant/command/halt.rb +39 -0
- data/lib/vagrant/command/init.rb +40 -0
- data/lib/vagrant/command/package.rb +75 -0
- data/lib/vagrant/command/provision.rb +40 -0
- data/lib/vagrant/command/reload.rb +39 -0
- data/lib/vagrant/command/resume.rb +33 -0
- data/lib/vagrant/command/ssh.rb +90 -0
- data/lib/vagrant/command/ssh_config.rb +51 -0
- data/lib/vagrant/command/start_mixins.rb +26 -0
- data/lib/vagrant/command/status.rb +36 -0
- data/lib/vagrant/command/suspend.rb +33 -0
- data/lib/vagrant/command/up.rb +40 -0
- data/lib/vagrant/communication.rb +7 -0
- data/lib/vagrant/communication/base.rb +56 -0
- data/lib/vagrant/communication/ssh.rb +230 -0
- data/lib/vagrant/config.rb +49 -0
- data/lib/vagrant/config/base.rb +82 -0
- data/lib/vagrant/config/container.rb +37 -0
- data/lib/vagrant/config/error_recorder.rb +19 -0
- data/lib/vagrant/config/loader.rb +127 -0
- data/lib/vagrant/config/nfs.rb +8 -0
- data/lib/vagrant/config/package.rb +7 -0
- data/lib/vagrant/config/ssh.rb +27 -0
- data/lib/vagrant/config/top.rb +72 -0
- data/lib/vagrant/config/vagrant.rb +14 -0
- data/lib/vagrant/config/vm.rb +168 -0
- data/lib/vagrant/config/vm/provisioner.rb +52 -0
- data/lib/vagrant/config/vm/sub_vm.rb +17 -0
- data/lib/vagrant/data_store.rb +92 -0
- data/lib/vagrant/downloaders.rb +7 -0
- data/lib/vagrant/downloaders/base.rb +25 -0
- data/lib/vagrant/downloaders/file.rb +22 -0
- data/lib/vagrant/downloaders/http.rb +97 -0
- data/lib/vagrant/driver.rb +8 -0
- data/lib/vagrant/driver/virtualbox.rb +134 -0
- data/lib/vagrant/driver/virtualbox_4_0.rb +459 -0
- data/lib/vagrant/driver/virtualbox_4_1.rb +459 -0
- data/lib/vagrant/driver/virtualbox_4_2.rb +606 -0
- data/lib/vagrant/driver/virtualbox_base.rb +326 -0
- data/lib/vagrant/environment.rb +522 -0
- data/lib/vagrant/errors.rb +445 -0
- data/lib/vagrant/guest.rb +18 -0
- data/lib/vagrant/guest/arch.rb +56 -0
- data/lib/vagrant/guest/base.rb +99 -0
- data/lib/vagrant/guest/debian.rb +64 -0
- data/lib/vagrant/guest/fedora.rb +66 -0
- data/lib/vagrant/guest/freebsd.rb +86 -0
- data/lib/vagrant/guest/gentoo.rb +46 -0
- data/lib/vagrant/guest/linux.rb +118 -0
- data/lib/vagrant/guest/linux/config.rb +19 -0
- data/lib/vagrant/guest/linux/error.rb +9 -0
- data/lib/vagrant/guest/openbsd.rb +20 -0
- data/lib/vagrant/guest/redhat.rb +67 -0
- data/lib/vagrant/guest/solaris.rb +118 -0
- data/lib/vagrant/guest/suse.rb +17 -0
- data/lib/vagrant/guest/ubuntu.rb +23 -0
- data/lib/vagrant/hosts.rb +37 -0
- data/lib/vagrant/hosts/arch.rb +55 -0
- data/lib/vagrant/hosts/base.rb +66 -0
- data/lib/vagrant/hosts/bsd.rb +97 -0
- data/lib/vagrant/hosts/fedora.rb +47 -0
- data/lib/vagrant/hosts/freebsd.rb +41 -0
- data/lib/vagrant/hosts/gentoo.rb +20 -0
- data/lib/vagrant/hosts/linux.rb +94 -0
- data/lib/vagrant/hosts/opensuse.rb +30 -0
- data/lib/vagrant/hosts/windows.rb +16 -0
- data/lib/vagrant/plugin.rb +81 -0
- data/lib/vagrant/provisioners.rb +12 -0
- data/lib/vagrant/provisioners/base.rb +44 -0
- data/lib/vagrant/provisioners/chef.rb +168 -0
- data/lib/vagrant/provisioners/chef_client.rb +132 -0
- data/lib/vagrant/provisioners/chef_solo.rb +234 -0
- data/lib/vagrant/provisioners/puppet.rb +176 -0
- data/lib/vagrant/provisioners/puppet_server.rb +78 -0
- data/lib/vagrant/provisioners/shell.rb +103 -0
- data/lib/vagrant/registry.rb +52 -0
- data/lib/vagrant/ssh.rb +126 -0
- data/lib/vagrant/test_helpers.rb +154 -0
- data/lib/vagrant/ui.rb +168 -0
- data/lib/vagrant/util.rb +12 -0
- data/lib/vagrant/util/ansi_escape_code_remover.rb +34 -0
- data/lib/vagrant/util/busy.rb +59 -0
- data/lib/vagrant/util/counter.rb +24 -0
- data/lib/vagrant/util/file_checksum.rb +38 -0
- data/lib/vagrant/util/file_mode.rb +12 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
- data/lib/vagrant/util/is_port_open.rb +38 -0
- data/lib/vagrant/util/line_ending_helpers.rb +14 -0
- data/lib/vagrant/util/network_ip.rb +28 -0
- data/lib/vagrant/util/platform.rb +68 -0
- data/lib/vagrant/util/retryable.rb +25 -0
- data/lib/vagrant/util/safe_exec.rb +36 -0
- data/lib/vagrant/util/safe_puts.rb +31 -0
- data/lib/vagrant/util/stacked_proc_runner.rb +35 -0
- data/lib/vagrant/util/subprocess.rb +247 -0
- data/lib/vagrant/util/template_renderer.rb +83 -0
- data/lib/vagrant/version.rb +6 -0
- data/lib/vagrant/vm.rb +195 -0
- data/tasks/acceptance.rake +113 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/test.rake +20 -0
- data/templates/commands/init/Vagrantfile.erb +99 -0
- data/templates/commands/ssh_config/config.erb +15 -0
- data/templates/config/validation_failed.erb +7 -0
- data/templates/guests/arch/network_dhcp.erb +7 -0
- data/templates/guests/arch/network_static.erb +7 -0
- data/templates/guests/debian/network_dhcp.erb +6 -0
- data/templates/guests/debian/network_static.erb +7 -0
- data/templates/guests/fedora/network_dhcp.erb +6 -0
- data/templates/guests/fedora/network_static.erb +13 -0
- data/templates/guests/freebsd/network_dhcp.erb +3 -0
- data/templates/guests/freebsd/network_static.erb +3 -0
- data/templates/guests/gentoo/network_dhcp.erb +4 -0
- data/templates/guests/gentoo/network_static.erb +4 -0
- data/templates/guests/redhat/network_dhcp.erb +6 -0
- data/templates/guests/redhat/network_static.erb +7 -0
- data/templates/locales/en.yml +759 -0
- data/templates/nfs/exports.erb +5 -0
- data/templates/nfs/exports_freebsd.erb +5 -0
- data/templates/nfs/exports_linux.erb +5 -0
- data/templates/package_Vagrantfile.erb +11 -0
- data/templates/provisioners/chef_client/client.erb +32 -0
- data/templates/provisioners/chef_solo/solo.erb +25 -0
- data/test/acceptance/base.rb +48 -0
- data/test/acceptance/box_test.rb +99 -0
- data/test/acceptance/destroy_test.rb +37 -0
- data/test/acceptance/halt_test.rb +72 -0
- data/test/acceptance/init_test.rb +33 -0
- data/test/acceptance/networking/host_only_test.rb +37 -0
- data/test/acceptance/networking/port_forward_test.rb +125 -0
- data/test/acceptance/package_test.rb +46 -0
- data/test/acceptance/provisioning/basic_test.rb +61 -0
- data/test/acceptance/provisioning/chef_solo_test.rb +37 -0
- data/test/acceptance/provisioning/shell_test.rb +53 -0
- data/test/acceptance/resume_test.rb +17 -0
- data/test/acceptance/shared_folders_test.rb +84 -0
- data/test/acceptance/skeletons/chef_solo_basic/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/skeletons/chef_solo_json/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +6 -0
- data/test/acceptance/skeletons/provisioner_multi/README.md +3 -0
- data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/ssh_test.rb +46 -0
- data/test/acceptance/support/config.rb +42 -0
- data/test/acceptance/support/isolated_environment.rb +117 -0
- data/test/acceptance/support/matchers/have_color.rb +9 -0
- data/test/acceptance/support/matchers/match_output.rb +14 -0
- data/test/acceptance/support/matchers/succeed.rb +14 -0
- data/test/acceptance/support/network_tests.rb +29 -0
- data/test/acceptance/support/output.rb +95 -0
- data/test/acceptance/support/shared/base_context.rb +72 -0
- data/test/acceptance/support/shared/command_examples.rb +33 -0
- data/test/acceptance/support/virtualbox.rb +36 -0
- data/test/acceptance/suspend_test.rb +56 -0
- data/test/acceptance/up_basic_test.rb +33 -0
- data/test/acceptance/up_with_box_url.rb +40 -0
- data/test/acceptance/vagrant_test.rb +47 -0
- data/test/acceptance/version_test.rb +15 -0
- data/test/buildbot/README.md +72 -0
- data/test/buildbot/buildbot_config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +24 -0
- data/test/buildbot/buildbot_config/config/master.py +24 -0
- data/test/buildbot/buildbot_config/config/slave.py +22 -0
- data/test/buildbot/buildbot_config/master/__init__.py +6 -0
- data/test/buildbot/buildbot_config/master/builders.py +78 -0
- data/test/buildbot/buildbot_config/master/buildsteps.py +100 -0
- data/test/buildbot/buildbot_config/master/change_sources.py +8 -0
- data/test/buildbot/buildbot_config/master/schedulers.py +32 -0
- data/test/buildbot/buildbot_config/master/slaves.py +60 -0
- data/test/buildbot/buildbot_config/master/status.py +52 -0
- data/test/buildbot/master/Makefile.sample +28 -0
- data/test/buildbot/master/buildbot.tac +36 -0
- data/test/buildbot/master/master.cfg +67 -0
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +545 -0
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +10 -0
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +356 -0
- data/test/buildbot/master/public_html/static/css/prettify.css +97 -0
- data/test/buildbot/master/public_html/static/css/syntax.css +60 -0
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +205 -0
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +80 -0
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +4 -0
- data/test/buildbot/master/templates/authfail.html +9 -0
- data/test/buildbot/master/templates/build.html +205 -0
- data/test/buildbot/master/templates/builder.html +118 -0
- data/test/buildbot/master/templates/builders.html +33 -0
- data/test/buildbot/master/templates/buildslave.html +72 -0
- data/test/buildbot/master/templates/buildslaves.html +70 -0
- data/test/buildbot/master/templates/change.html +15 -0
- data/test/buildbot/master/templates/layouts/base.html +58 -0
- data/test/buildbot/master/templates/macros/box.html +37 -0
- data/test/buildbot/master/templates/macros/build_line.html +50 -0
- data/test/buildbot/master/templates/macros/change.html +81 -0
- data/test/buildbot/master/templates/macros/forms.html +300 -0
- data/test/buildbot/master/templates/root.html +42 -0
- data/test/buildbot/master/templates/waterfall.html +53 -0
- data/test/buildbot/requirements.txt +4 -0
- data/test/buildbot/scripts/deploy.sh +38 -0
- data/test/buildbot/scripts/setup.sh +107 -0
- data/test/buildbot/slave/buildbot.tac +43 -0
- data/test/buildbot/slave/info/admin +1 -0
- data/test/buildbot/slave/info/host +1 -0
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +41 -0
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/config/acceptance_boxes.yml +7 -0
- data/test/support/isolated_environment.rb +46 -0
- data/test/support/tempdir.rb +34 -0
- data/test/unit/base.rb +21 -0
- data/test/unit/support/isolated_environment.rb +47 -0
- data/test/unit/support/shared/base_context.rb +30 -0
- data/test/unit/vagrant/action/builder_test.rb +156 -0
- data/test/unit/vagrant/action/environment_test.rb +16 -0
- data/test/unit/vagrant/action/runner_test.rb +65 -0
- data/test/unit/vagrant/action/warden_test.rb +92 -0
- data/test/unit/vagrant/box_collection_test.rb +56 -0
- data/test/unit/vagrant/box_test.rb +34 -0
- data/test/unit/vagrant/command/base_test.rb +150 -0
- data/test/unit/vagrant/config/base_test.rb +48 -0
- data/test/unit/vagrant/config/loader_test.rb +79 -0
- data/test/unit/vagrant/config/ssh_test.rb +17 -0
- data/test/unit/vagrant/config/top_test.rb +69 -0
- data/test/unit/vagrant/config/vm_test.rb +71 -0
- data/test/unit/vagrant/config_test.rb +27 -0
- data/test/unit/vagrant/data_store_test.rb +79 -0
- data/test/unit/vagrant/downloaders/base_test.rb +18 -0
- data/test/unit/vagrant/downloaders/file_test.rb +75 -0
- data/test/unit/vagrant/downloaders/http_test.rb +19 -0
- data/test/unit/vagrant/environment_test.rb +220 -0
- data/test/unit/vagrant/hosts_test.rb +36 -0
- data/test/unit/vagrant/registry_test.rb +74 -0
- data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +16 -0
- data/test/unit/vagrant/util/file_checksum_test.rb +23 -0
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +38 -0
- data/test/unit/vagrant/util/is_port_open_test.rb +53 -0
- data/test/unit/vagrant/util/line_endings_helper_test.rb +16 -0
- data/test/unit/vagrant/util/network_ip_test.rb +17 -0
- data/test/unit/vagrant/util/retryable_test.rb +106 -0
- data/test/unit/vagrant_test.rb +27 -0
- data/test/unit_legacy/locales/en.yml +8 -0
- data/test/unit_legacy/test_helper.rb +32 -0
- data/test/unit_legacy/vagrant/action/box/destroy_test.rb +18 -0
- data/test/unit_legacy/vagrant/action/box/download_test.rb +125 -0
- data/test/unit_legacy/vagrant/action/box/package_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +84 -0
- data/test/unit_legacy/vagrant/action/box/verify_test.rb +30 -0
- data/test/unit_legacy/vagrant/action/env/set_test.rb +24 -0
- data/test/unit_legacy/vagrant/action/general/package_test.rb +268 -0
- data/test/unit_legacy/vagrant/action/general/validate_test.rb +31 -0
- data/test/unit_legacy/vagrant/action/vm/boot_test.rb +66 -0
- data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +61 -0
- data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +61 -0
- data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +9 -0
- data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +84 -0
- data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +52 -0
- data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +22 -0
- data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +40 -0
- data/test/unit_legacy/vagrant/action/vm/customize_test.rb +37 -0
- data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +49 -0
- data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +45 -0
- data/test/unit_legacy/vagrant/action/vm/export_test.rb +107 -0
- data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +77 -0
- data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +197 -0
- data/test/unit_legacy/vagrant/action/vm/halt_test.rb +79 -0
- data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +36 -0
- data/test/unit_legacy/vagrant/action/vm/import_test.rb +66 -0
- data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +40 -0
- data/test/unit_legacy/vagrant/action/vm/modify_test.rb +38 -0
- data/test/unit_legacy/vagrant/action/vm/network_test.rb +286 -0
- data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +26 -0
- data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +260 -0
- data/test/unit_legacy/vagrant/action/vm/package_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +46 -0
- data/test/unit_legacy/vagrant/action/vm/provision_test.rb +65 -0
- data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +56 -0
- data/test/unit_legacy/vagrant/action/vm/resume_test.rb +35 -0
- data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +144 -0
- data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +35 -0
- data/test/unit_legacy/vagrant/action_test.rb +89 -0
- data/test/unit_legacy/vagrant/box_collection_test.rb +45 -0
- data/test/unit_legacy/vagrant/box_test.rb +74 -0
- data/test/unit_legacy/vagrant/cli_test.rb +35 -0
- data/test/unit_legacy/vagrant/command/base_test.rb +23 -0
- data/test/unit_legacy/vagrant/command/group_base_test.rb +15 -0
- data/test/unit_legacy/vagrant/command/helpers_test.rb +88 -0
- data/test/unit_legacy/vagrant/command/init_test.rb +10 -0
- data/test/unit_legacy/vagrant/command/package_test.rb +27 -0
- data/test/unit_legacy/vagrant/config/base_test.rb +52 -0
- data/test/unit_legacy/vagrant/config/error_recorder_test.rb +18 -0
- data/test/unit_legacy/vagrant/config/ssh_test.rb +12 -0
- data/test/unit_legacy/vagrant/config/vagrant_test.rb +35 -0
- data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +92 -0
- data/test/unit_legacy/vagrant/config/vm_test.rb +47 -0
- data/test/unit_legacy/vagrant/config_test.rb +148 -0
- data/test/unit_legacy/vagrant/downloaders/http_test.rb +93 -0
- data/test/unit_legacy/vagrant/environment_test.rb +539 -0
- data/test/unit_legacy/vagrant/errors_test.rb +42 -0
- data/test/unit_legacy/vagrant/hosts/base_test.rb +46 -0
- data/test/unit_legacy/vagrant/hosts/bsd_test.rb +53 -0
- data/test/unit_legacy/vagrant/hosts/linux_test.rb +54 -0
- data/test/unit_legacy/vagrant/plugin_test.rb +9 -0
- data/test/unit_legacy/vagrant/provisioners/base_test.rb +63 -0
- data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +190 -0
- data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +115 -0
- data/test/unit_legacy/vagrant/provisioners/chef_test.rb +209 -0
- data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +68 -0
- data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +182 -0
- data/test/unit_legacy/vagrant/provisioners/shell_test.rb +79 -0
- data/test/unit_legacy/vagrant/ssh/session_test.rb +40 -0
- data/test/unit_legacy/vagrant/ssh_test.rb +304 -0
- data/test/unit_legacy/vagrant/systems/base_test.rb +18 -0
- data/test/unit_legacy/vagrant/systems/linux_test.rb +104 -0
- data/test/unit_legacy/vagrant/util/busy_test.rb +106 -0
- data/test/unit_legacy/vagrant/util/counter_test.rb +29 -0
- data/test/unit_legacy/vagrant/util/platform_test.rb +18 -0
- data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +43 -0
- data/test/unit_legacy/vagrant/util/template_renderer_test.rb +145 -0
- data/test/unit_legacy/vagrant/vm_test.rb +300 -0
- data/vagrant-fixed-ssh.gemspec +70 -0
- metadata +712 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Config
|
3
|
+
# Contains loaded configuration values and provides access to those
|
4
|
+
# values.
|
5
|
+
#
|
6
|
+
# This is the class returned when loading configuration and stores
|
7
|
+
# the completely loaded configuration values. This class is meant to
|
8
|
+
# be immutable.
|
9
|
+
class Container
|
10
|
+
attr_reader :global
|
11
|
+
attr_reader :vms
|
12
|
+
|
13
|
+
# Initializes the configuration container.
|
14
|
+
#
|
15
|
+
# @param [Top] global Top-level configuration for the global
|
16
|
+
# applicatoin.
|
17
|
+
# @param [Array] vms Array of VM configurations.
|
18
|
+
def initialize(global, vms)
|
19
|
+
@global = global
|
20
|
+
@vms = []
|
21
|
+
@vm_configs = {}
|
22
|
+
|
23
|
+
vms.each do |vm_config|
|
24
|
+
@vms << vm_config.vm.name
|
25
|
+
@vm_configs[vm_config.vm.name] = vm_config
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# This returns the configuration for a specific virtual machine.
|
30
|
+
# The values for this configuration are usually pertinent to a
|
31
|
+
# single virtual machine and do not affect the system globally.
|
32
|
+
def for_vm(name)
|
33
|
+
@vm_configs[name]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Config
|
3
|
+
# A class which is passed into the various {Base#validate} methods and
|
4
|
+
# can be used as a helper to add error messages about a single config
|
5
|
+
# class.
|
6
|
+
class ErrorRecorder
|
7
|
+
attr_reader :errors
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@errors = []
|
11
|
+
end
|
12
|
+
|
13
|
+
# Adds an error to the list of errors.
|
14
|
+
def add(message)
|
15
|
+
@errors << message
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
require "pathname"
|
2
|
+
|
3
|
+
require "log4r"
|
4
|
+
|
5
|
+
module Vagrant
|
6
|
+
module Config
|
7
|
+
# This class is responsible for loading Vagrant configuration,
|
8
|
+
# usually in the form of Vagrantfiles.
|
9
|
+
#
|
10
|
+
# Loading works by specifying the sources for the configuration
|
11
|
+
# as well as the order the sources should be loaded. Configuration
|
12
|
+
# set later always overrides those set earlier; this is how
|
13
|
+
# configuration "scoping" is implemented.
|
14
|
+
class Loader
|
15
|
+
# This is an array of symbols specifying the order in which
|
16
|
+
# configuration is loaded. For examples, see the class documentation.
|
17
|
+
attr_accessor :load_order
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
@logger = Log4r::Logger.new("vagrant::config::loader")
|
21
|
+
@sources = {}
|
22
|
+
@proc_cache = {}
|
23
|
+
@config_cache = {}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Set the configuration data for the given name.
|
27
|
+
#
|
28
|
+
# The `name` should be a symbol and must uniquely identify the data
|
29
|
+
# being given.
|
30
|
+
#
|
31
|
+
# `data` can either be a path to a Ruby Vagrantfile or a `Proc` directly.
|
32
|
+
# `data` can also be an array of such values.
|
33
|
+
#
|
34
|
+
# At this point, no configuration is actually loaded. Note that calling
|
35
|
+
# `set` multiple times with the same name will override any previously
|
36
|
+
# set values. In this way, the last set data for a given name wins.
|
37
|
+
def set(name, sources)
|
38
|
+
@logger.debug("Set #{name.inspect} = #{sources.inspect}")
|
39
|
+
|
40
|
+
# Sources should be an array
|
41
|
+
sources = [sources] if !sources.kind_of?(Array)
|
42
|
+
|
43
|
+
# Gather the procs for every source, since that is what we care about.
|
44
|
+
procs = []
|
45
|
+
sources.each do |source|
|
46
|
+
if !@proc_cache.has_key?(source)
|
47
|
+
# Load the procs for this source and cache them. This caching
|
48
|
+
# avoids the issue where a file may have side effects when loading
|
49
|
+
# and loading it multiple times causes unexpected behavior.
|
50
|
+
@logger.debug("Populating proc cache for #{source.inspect}")
|
51
|
+
@proc_cache[source] = procs_for_source(source)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Add on to the array of procs we're going to use
|
55
|
+
procs.concat(@proc_cache[source])
|
56
|
+
end
|
57
|
+
|
58
|
+
# Set this source by name.
|
59
|
+
@sources[name] = procs
|
60
|
+
end
|
61
|
+
|
62
|
+
# This loads the configured sources in the configured order and returns
|
63
|
+
# an actual configuration object that is ready to be used.
|
64
|
+
def load
|
65
|
+
@logger.debug("Loading configuration in order: #{@load_order.inspect}")
|
66
|
+
|
67
|
+
unknown_sources = @sources.keys - @load_order
|
68
|
+
if !unknown_sources.empty?
|
69
|
+
# TODO: Raise exception here perhaps.
|
70
|
+
@logger.error("Unknown config sources: #{unknown_sources.inspect}")
|
71
|
+
end
|
72
|
+
|
73
|
+
# Create the top-level configuration which will hold all the config.
|
74
|
+
result = Top.new
|
75
|
+
|
76
|
+
@load_order.each do |key|
|
77
|
+
next if !@sources.has_key?(key)
|
78
|
+
|
79
|
+
@sources[key].each do |proc|
|
80
|
+
if !@config_cache.has_key?(proc)
|
81
|
+
@logger.debug("Loading from: #{key} (evaluating)")
|
82
|
+
current = Top.new
|
83
|
+
proc.call(current)
|
84
|
+
@config_cache[proc] = current
|
85
|
+
else
|
86
|
+
@logger.debug("Loading from: #{key} (cache)")
|
87
|
+
end
|
88
|
+
|
89
|
+
# Merge in the results of this proc's configuration
|
90
|
+
result = result.merge(@config_cache[proc])
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
@logger.debug("Configuration loaded successfully")
|
95
|
+
result
|
96
|
+
end
|
97
|
+
|
98
|
+
protected
|
99
|
+
|
100
|
+
# This returns an array of `Proc` objects for the given source.
|
101
|
+
# The `Proc` objects returned will expect a single argument for
|
102
|
+
# the configuration object and are expected to mutate this
|
103
|
+
# configuration object.
|
104
|
+
def procs_for_source(source)
|
105
|
+
return [source] if source.is_a?(Proc)
|
106
|
+
|
107
|
+
# Assume all string sources are actually pathnames
|
108
|
+
source = Pathname.new(source) if source.is_a?(String)
|
109
|
+
|
110
|
+
if source.is_a?(Pathname)
|
111
|
+
@logger.debug("Load procs for pathname: #{source.inspect}")
|
112
|
+
|
113
|
+
begin
|
114
|
+
return Config.capture_configures do
|
115
|
+
Kernel.load source
|
116
|
+
end
|
117
|
+
rescue SyntaxError => e
|
118
|
+
# Report syntax errors in a nice way.
|
119
|
+
raise Errors::VagrantfileSyntaxError, :file => e.message
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
raise Exception, "Unknown configuration source: #{source.inspect}"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Config
|
3
|
+
class SSHConfig < Base
|
4
|
+
attr_accessor :username
|
5
|
+
attr_accessor :password
|
6
|
+
attr_accessor :host
|
7
|
+
attr_accessor :port
|
8
|
+
attr_accessor :guest_port
|
9
|
+
attr_accessor :max_tries
|
10
|
+
attr_accessor :timeout
|
11
|
+
attr_accessor :private_key_path
|
12
|
+
attr_accessor :forward_agent
|
13
|
+
attr_accessor :forward_x11
|
14
|
+
attr_accessor :shell
|
15
|
+
|
16
|
+
def validate(env, errors)
|
17
|
+
[:username, :host, :max_tries, :timeout].each do |field|
|
18
|
+
errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym)
|
19
|
+
end
|
20
|
+
|
21
|
+
if private_key_path && !File.file?(File.expand_path(private_key_path, env.root_path))
|
22
|
+
errors.add(I18n.t("vagrant.config.ssh.private_key_missing", :path => private_key_path))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Config
|
3
|
+
# This class is the "top" configure class, which handles registering
|
4
|
+
# other configuration classes as well as validation of all configured
|
5
|
+
# classes. This is the object which is returned by {Environment#config}
|
6
|
+
# and has accessors to all other configuration classes.
|
7
|
+
#
|
8
|
+
# If you're looking to create your own configuration class, see {Base}.
|
9
|
+
class Top < Base
|
10
|
+
attr_reader :keys
|
11
|
+
|
12
|
+
def initialize(registry=nil)
|
13
|
+
@keys = {}
|
14
|
+
@registry = registry || Vagrant.config_keys
|
15
|
+
end
|
16
|
+
|
17
|
+
# We use method_missing as a way to get the configuration that is used
|
18
|
+
# for Vagrant and load the proper configuration classes for each.
|
19
|
+
def method_missing(name, *args)
|
20
|
+
return @keys[name] if @keys.has_key?(name)
|
21
|
+
|
22
|
+
config_klass = @registry.get(name.to_sym)
|
23
|
+
if config_klass
|
24
|
+
# Instantiate the class and return the instance
|
25
|
+
@keys[name] = config_klass.new
|
26
|
+
return @keys[name]
|
27
|
+
else
|
28
|
+
# Super it up to probably raise a NoMethodError
|
29
|
+
super
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Custom implementation to merge each key separately.
|
34
|
+
def merge(other)
|
35
|
+
result = self.class.new
|
36
|
+
@keys.each do |key, value|
|
37
|
+
result.keys[key] = value.merge(other.send(key))
|
38
|
+
end
|
39
|
+
|
40
|
+
other.keys.each do |key, value|
|
41
|
+
if !@keys.has_key?(key)
|
42
|
+
# This is a key that the other configuration class has
|
43
|
+
# that we don't, so just copy it in.
|
44
|
+
result.keys[key] = value.dup
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
result
|
49
|
+
end
|
50
|
+
|
51
|
+
# Validates the configuration classes of this instance and raises an
|
52
|
+
# exception if they are invalid. If you are implementing a custom configuration
|
53
|
+
# class, the method you want to implement is {Base#validate}. This is
|
54
|
+
# the method that checks all the validation, not one which defines
|
55
|
+
# validation rules.
|
56
|
+
def validate!(env)
|
57
|
+
# Validate each of the configured classes and store the results into
|
58
|
+
# a hash.
|
59
|
+
errors = @keys.inject({}) do |container, data|
|
60
|
+
key, instance = data
|
61
|
+
recorder = ErrorRecorder.new
|
62
|
+
instance.validate(env, recorder)
|
63
|
+
container[key.to_sym] = recorder if !recorder.errors.empty?
|
64
|
+
container
|
65
|
+
end
|
66
|
+
|
67
|
+
return if errors.empty?
|
68
|
+
raise Errors::ConfigValidationFailed, :messages => Util::TemplateRenderer.render("config/validation_failed", :errors => errors)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Config
|
3
|
+
class VagrantConfig < Base
|
4
|
+
attr_accessor :dotfile_name
|
5
|
+
attr_accessor :host
|
6
|
+
|
7
|
+
def validate(env, errors)
|
8
|
+
[:dotfile_name, :host].each do |field|
|
9
|
+
errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
require 'vagrant/config/vm/sub_vm'
|
4
|
+
require 'vagrant/config/vm/provisioner'
|
5
|
+
|
6
|
+
module Vagrant
|
7
|
+
module Config
|
8
|
+
class VMConfig < Base
|
9
|
+
attr_accessor :name
|
10
|
+
attr_accessor :auto_port_range
|
11
|
+
attr_accessor :box
|
12
|
+
attr_accessor :box_url
|
13
|
+
attr_accessor :base_mac
|
14
|
+
attr_accessor :boot_mode
|
15
|
+
attr_accessor :host_name
|
16
|
+
attr_reader :forwarded_ports
|
17
|
+
attr_reader :shared_folders
|
18
|
+
attr_reader :networks
|
19
|
+
attr_reader :provisioners
|
20
|
+
attr_reader :customizations
|
21
|
+
attr_accessor :guest
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
@forwarded_ports = []
|
25
|
+
@shared_folders = {}
|
26
|
+
@networks = []
|
27
|
+
@provisioners = []
|
28
|
+
@customizations = []
|
29
|
+
end
|
30
|
+
|
31
|
+
# Custom merge method since some keys here are merged differently.
|
32
|
+
def merge(other)
|
33
|
+
result = super
|
34
|
+
result.instance_variable_set(:@forwarded_ports, @forwarded_ports + other.forwarded_ports)
|
35
|
+
result.instance_variable_set(:@shared_folders, @shared_folders.merge(other.shared_folders))
|
36
|
+
result.instance_variable_set(:@networks, @networks + other.networks)
|
37
|
+
result.instance_variable_set(:@provisioners, @provisioners + other.provisioners)
|
38
|
+
result.instance_variable_set(:@customizations, @customizations + other.customizations)
|
39
|
+
result
|
40
|
+
end
|
41
|
+
|
42
|
+
def forward_port(guestport, hostport, options=nil)
|
43
|
+
@forwarded_ports << {
|
44
|
+
:name => "#{guestport.to_s(32)}-#{hostport.to_s(32)}",
|
45
|
+
:guestport => guestport,
|
46
|
+
:hostport => hostport,
|
47
|
+
:protocol => :tcp,
|
48
|
+
:adapter => 1,
|
49
|
+
:auto => false
|
50
|
+
}.merge(options || {})
|
51
|
+
end
|
52
|
+
|
53
|
+
def share_folder(name, guestpath, hostpath, opts=nil)
|
54
|
+
@shared_folders[name] = {
|
55
|
+
:guestpath => guestpath.to_s,
|
56
|
+
:hostpath => hostpath.to_s,
|
57
|
+
:create => false,
|
58
|
+
:owner => nil,
|
59
|
+
:group => nil,
|
60
|
+
:nfs => false,
|
61
|
+
:transient => false,
|
62
|
+
:extra => nil
|
63
|
+
}.merge(opts || {})
|
64
|
+
end
|
65
|
+
|
66
|
+
def network(type, *args)
|
67
|
+
@networks << [type, args]
|
68
|
+
end
|
69
|
+
|
70
|
+
def provision(name, options=nil, &block)
|
71
|
+
@provisioners << Provisioner.new(name, options, &block)
|
72
|
+
end
|
73
|
+
|
74
|
+
# TODO: This argument should not be `nil` in the future.
|
75
|
+
# It is only defaulted to nil so that the deprecation error
|
76
|
+
# can be properly shown.
|
77
|
+
def customize(command=nil)
|
78
|
+
@customizations << command if command
|
79
|
+
end
|
80
|
+
|
81
|
+
def defined_vms
|
82
|
+
@defined_vms ||= {}
|
83
|
+
end
|
84
|
+
|
85
|
+
# This returns the keys of the sub-vms in the order they were
|
86
|
+
# defined.
|
87
|
+
def defined_vm_keys
|
88
|
+
@defined_vm_keys ||= []
|
89
|
+
end
|
90
|
+
|
91
|
+
def define(name, options=nil, &block)
|
92
|
+
name = name.to_sym
|
93
|
+
options ||= {}
|
94
|
+
|
95
|
+
# Add the name to the array of VM keys. This array is used to
|
96
|
+
# preserve the order in which VMs are defined.
|
97
|
+
defined_vm_keys << name
|
98
|
+
|
99
|
+
# Add the SubVM to the hash of defined VMs
|
100
|
+
defined_vms[name] ||= SubVM.new
|
101
|
+
defined_vms[name].options.merge!(options)
|
102
|
+
defined_vms[name].push_proc(&block) if block
|
103
|
+
end
|
104
|
+
|
105
|
+
def validate(env, errors)
|
106
|
+
errors.add(I18n.t("vagrant.config.vm.box_missing")) if !box
|
107
|
+
errors.add(I18n.t("vagrant.config.vm.box_not_found", :name => box)) if box && !box_url && !env.boxes.find(box)
|
108
|
+
errors.add(I18n.t("vagrant.config.vm.boot_mode_invalid")) if ![:headless, :gui].include?(boot_mode.to_sym)
|
109
|
+
errors.add(I18n.t("vagrant.config.vm.base_mac_invalid")) if env.boxes.find(box) && !base_mac
|
110
|
+
|
111
|
+
shared_folders.each do |name, options|
|
112
|
+
hostpath = Pathname.new(options[:hostpath]).expand_path(env.root_path)
|
113
|
+
|
114
|
+
if !hostpath.directory? && !options[:create]
|
115
|
+
errors.add(I18n.t("vagrant.config.vm.shared_folder_hostpath_missing",
|
116
|
+
:name => name,
|
117
|
+
:path => options[:hostpath]))
|
118
|
+
end
|
119
|
+
|
120
|
+
if options[:nfs] && (options[:owner] || options[:group])
|
121
|
+
# Owner/group don't work with NFS
|
122
|
+
errors.add(I18n.t("vagrant.config.vm.shared_folder_nfs_owner_group",
|
123
|
+
:name => name))
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Validate some basic networking
|
128
|
+
#
|
129
|
+
# TODO: One day we need to abstract this out, since in the future
|
130
|
+
# providers other than VirtualBox will not be able to satisfy
|
131
|
+
# all types of networks.
|
132
|
+
networks.each do |type, args|
|
133
|
+
if type == :hostonly && args[0] == :dhcp
|
134
|
+
# Valid. There is no real way this can be invalid at the moment.
|
135
|
+
elsif type == :hostonly
|
136
|
+
# Validate the host-only network
|
137
|
+
ip = args[0]
|
138
|
+
options = args[1] || {}
|
139
|
+
|
140
|
+
if !ip
|
141
|
+
errors.add(I18n.t("vagrant.config.vm.network_ip_required"))
|
142
|
+
else
|
143
|
+
ip_parts = ip.split(".")
|
144
|
+
|
145
|
+
if ip_parts.length != 4
|
146
|
+
errors.add(I18n.t("vagrant.config.vm.network_ip_invalid",
|
147
|
+
:ip => ip))
|
148
|
+
elsif ip_parts.last == "1"
|
149
|
+
errors.add(I18n.t("vagrant.config.vm.network_ip_ends_one",
|
150
|
+
:ip => ip))
|
151
|
+
end
|
152
|
+
end
|
153
|
+
elsif type == :bridged
|
154
|
+
else
|
155
|
+
# Invalid network type
|
156
|
+
errors.add(I18n.t("vagrant.config.vm.network_invalid",
|
157
|
+
:type => type.to_s))
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Each provisioner can validate itself
|
162
|
+
provisioners.each do |prov|
|
163
|
+
prov.validate(env, errors)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|