vagrantup 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.yardopts +1 -0
  4. data/CHANGELOG.md +56 -0
  5. data/Gemfile +14 -3
  6. data/Gemfile.lock +38 -11
  7. data/README.md +1 -1
  8. data/bin/vagrant +20 -5
  9. data/config/default.rb +6 -8
  10. data/lib/vagrant.rb +40 -13
  11. data/lib/vagrant/action.rb +56 -16
  12. data/lib/vagrant/action/box/destroy.rb +3 -1
  13. data/lib/vagrant/action/box/download.rb +8 -13
  14. data/lib/vagrant/action/box/unpackage.rb +8 -11
  15. data/lib/vagrant/action/box/verify.rb +3 -3
  16. data/lib/vagrant/action/builder.rb +3 -30
  17. data/lib/vagrant/action/builtin.rb +6 -1
  18. data/lib/vagrant/action/environment.rb +14 -62
  19. data/lib/vagrant/action/general/package.rb +29 -22
  20. data/lib/vagrant/action/vm/boot.rb +5 -12
  21. data/lib/vagrant/action/vm/check_box.rb +4 -4
  22. data/lib/vagrant/action/vm/check_guest_additions.rb +4 -6
  23. data/lib/vagrant/action/vm/clear_forwarded_ports.rb +2 -2
  24. data/lib/vagrant/action/vm/clear_nfs_exports.rb +1 -1
  25. data/lib/vagrant/action/vm/clear_shared_folders.rb +1 -1
  26. data/lib/vagrant/action/vm/customize.rb +1 -1
  27. data/lib/vagrant/action/vm/destroy.rb +1 -2
  28. data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +1 -1
  29. data/lib/vagrant/action/vm/disable_networks.rb +11 -9
  30. data/lib/vagrant/action/vm/discard_state.rb +2 -2
  31. data/lib/vagrant/action/vm/export.rb +10 -11
  32. data/lib/vagrant/action/vm/forward_ports.rb +21 -9
  33. data/lib/vagrant/action/vm/halt.rb +3 -8
  34. data/lib/vagrant/action/vm/import.rb +16 -14
  35. data/lib/vagrant/action/vm/match_mac_address.rb +1 -1
  36. data/lib/vagrant/action/vm/network.rb +9 -16
  37. data/lib/vagrant/action/vm/nfs.rb +14 -18
  38. data/lib/vagrant/action/vm/provision.rb +5 -5
  39. data/lib/vagrant/action/vm/resume.rb +1 -1
  40. data/lib/vagrant/action/vm/share_folders.rb +6 -44
  41. data/lib/vagrant/action/vm/suspend.rb +1 -1
  42. data/lib/vagrant/action/warden.rb +74 -0
  43. data/lib/vagrant/box.rb +18 -82
  44. data/lib/vagrant/box_collection.rb +47 -0
  45. data/lib/vagrant/cli.rb +55 -0
  46. data/lib/vagrant/command/base.rb +106 -0
  47. data/lib/vagrant/command/box.rb +33 -0
  48. data/lib/vagrant/command/destroy.rb +17 -0
  49. data/lib/vagrant/command/group_base.rb +99 -0
  50. data/lib/vagrant/command/halt.rb +18 -0
  51. data/lib/vagrant/command/helpers.rb +33 -0
  52. data/lib/vagrant/command/init.rb +14 -0
  53. data/lib/vagrant/command/named_base.rb +14 -0
  54. data/lib/vagrant/command/package.rb +41 -0
  55. data/lib/vagrant/command/provision.rb +17 -0
  56. data/lib/vagrant/command/reload.rb +17 -0
  57. data/lib/vagrant/command/resume.rb +17 -0
  58. data/lib/vagrant/command/ssh.rb +41 -0
  59. data/lib/vagrant/command/ssh_config.rb +21 -0
  60. data/lib/vagrant/command/status.rb +23 -0
  61. data/lib/vagrant/command/suspend.rb +17 -0
  62. data/lib/vagrant/command/up.rb +20 -0
  63. data/lib/vagrant/command/upgrade_to_060.rb +45 -0
  64. data/lib/vagrant/command/version.rb +13 -0
  65. data/lib/vagrant/config.rb +107 -189
  66. data/lib/vagrant/config/base.rb +67 -0
  67. data/lib/vagrant/config/error_recorder.rb +19 -0
  68. data/lib/vagrant/config/nfs.rb +10 -0
  69. data/lib/vagrant/config/package.rb +9 -0
  70. data/lib/vagrant/config/ssh.rb +28 -0
  71. data/lib/vagrant/config/vagrant.rb +21 -0
  72. data/lib/vagrant/config/vm.rb +111 -0
  73. data/lib/vagrant/data_store.rb +68 -0
  74. data/lib/vagrant/downloaders/file.rb +3 -3
  75. data/lib/vagrant/downloaders/http.rb +5 -5
  76. data/lib/vagrant/environment.rb +246 -243
  77. data/lib/vagrant/errors.rb +306 -0
  78. data/lib/vagrant/hosts/base.rb +1 -1
  79. data/lib/vagrant/hosts/bsd.rb +3 -9
  80. data/lib/vagrant/hosts/linux.rb +3 -9
  81. data/lib/vagrant/plugin.rb +50 -0
  82. data/lib/vagrant/provisioners/base.rb +0 -6
  83. data/lib/vagrant/provisioners/chef.rb +63 -58
  84. data/lib/vagrant/provisioners/chef_server.rb +9 -11
  85. data/lib/vagrant/provisioners/chef_solo.rb +2 -2
  86. data/lib/vagrant/ssh.rb +34 -37
  87. data/lib/vagrant/systems/base.rb +0 -13
  88. data/lib/vagrant/systems/linux.rb +10 -33
  89. data/lib/vagrant/systems/solaris.rb +59 -0
  90. data/lib/vagrant/test_helpers.rb +109 -0
  91. data/lib/vagrant/ui.rb +65 -0
  92. data/lib/vagrant/util.rb +9 -19
  93. data/lib/vagrant/util/glob_loader.rb +19 -17
  94. data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
  95. data/lib/vagrant/util/plain_logger.rb +2 -0
  96. data/lib/vagrant/util/platform.rb +2 -0
  97. data/lib/vagrant/util/resource_logger.rb +5 -70
  98. data/lib/vagrant/util/retryable.rb +25 -0
  99. data/lib/vagrant/util/template_renderer.rb +1 -1
  100. data/lib/vagrant/version.rb +1 -1
  101. data/lib/vagrant/vm.rb +27 -13
  102. data/templates/commands/init/Vagrantfile.erb +13 -0
  103. data/templates/config/validation_failed.erb +7 -0
  104. data/templates/locales/en.yml +402 -0
  105. data/templates/package_Vagrantfile.erb +1 -1
  106. data/test/locales/en.yml +8 -0
  107. data/test/test_helper.rb +19 -103
  108. data/test/vagrant/action/box/destroy_test.rb +7 -19
  109. data/test/vagrant/action/box/download_test.rb +9 -25
  110. data/test/vagrant/action/box/package_test.rb +2 -2
  111. data/test/vagrant/action/box/unpackage_test.rb +8 -34
  112. data/test/vagrant/action/box/verify_test.rb +10 -19
  113. data/test/vagrant/action/builder_test.rb +0 -15
  114. data/test/vagrant/action/env/set_test.rb +1 -1
  115. data/test/vagrant/action/environment_test.rb +8 -26
  116. data/test/vagrant/action/general/package_test.rb +53 -53
  117. data/test/vagrant/action/vm/boot_test.rb +5 -22
  118. data/test/vagrant/action/vm/check_box_test.rb +35 -25
  119. data/test/vagrant/action/vm/clean_machine_folder_test.rb +1 -1
  120. data/test/vagrant/action/vm/clear_forwarded_ports_test.rb +1 -1
  121. data/test/vagrant/action/vm/clear_nfs_exports_test.rb +1 -1
  122. data/test/vagrant/action/vm/clear_shared_folders_test.rb +1 -1
  123. data/test/vagrant/action/vm/customize_test.rb +2 -1
  124. data/test/vagrant/action/vm/destroy_test.rb +1 -2
  125. data/test/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +1 -1
  126. data/test/vagrant/action/vm/disable_networks_test.rb +10 -1
  127. data/test/vagrant/action/vm/discard_state_test.rb +10 -1
  128. data/test/vagrant/action/vm/export_test.rb +9 -37
  129. data/test/vagrant/action/vm/forward_ports_helpers_test.rb +2 -2
  130. data/test/vagrant/action/vm/forward_ports_test.rb +19 -16
  131. data/test/vagrant/action/vm/halt_test.rb +11 -1
  132. data/test/vagrant/action/vm/import_test.rb +37 -21
  133. data/test/vagrant/action/vm/match_mac_address_test.rb +1 -1
  134. data/test/vagrant/action/vm/network_test.rb +8 -7
  135. data/test/vagrant/action/vm/nfs_helpers_test.rb +6 -3
  136. data/test/vagrant/action/vm/nfs_test.rb +20 -45
  137. data/test/vagrant/action/vm/package_test.rb +1 -1
  138. data/test/vagrant/action/vm/package_vagrantfile_test.rb +1 -1
  139. data/test/vagrant/action/vm/provision_test.rb +10 -17
  140. data/test/vagrant/action/vm/resume_test.rb +1 -1
  141. data/test/vagrant/action/vm/share_folders_test.rb +25 -106
  142. data/test/vagrant/action/vm/suspend_test.rb +1 -1
  143. data/test/vagrant/action/warden_test.rb +105 -0
  144. data/test/vagrant/action_test.rb +5 -27
  145. data/test/vagrant/box_collection_test.rb +44 -0
  146. data/test/vagrant/box_test.rb +5 -105
  147. data/test/vagrant/cli_test.rb +35 -0
  148. data/test/vagrant/command/base_test.rb +23 -0
  149. data/test/vagrant/command/group_base_test.rb +15 -0
  150. data/test/vagrant/command/helpers_test.rb +88 -0
  151. data/test/vagrant/config/base_test.rb +52 -0
  152. data/test/vagrant/config/error_recorder_test.rb +18 -0
  153. data/test/vagrant/config/ssh_test.rb +12 -0
  154. data/test/vagrant/config/vagrant_test.rb +11 -0
  155. data/test/vagrant/config/vm_test.rb +70 -0
  156. data/test/vagrant/config_test.rb +113 -206
  157. data/test/vagrant/data_store_test.rb +68 -0
  158. data/test/vagrant/downloaders/base_test.rb +1 -1
  159. data/test/vagrant/downloaders/file_test.rb +4 -3
  160. data/test/vagrant/downloaders/http_test.rb +14 -4
  161. data/test/vagrant/environment_test.rb +290 -590
  162. data/test/vagrant/errors_test.rb +42 -0
  163. data/test/vagrant/hosts/base_test.rb +1 -1
  164. data/test/vagrant/hosts/bsd_test.rb +3 -6
  165. data/test/vagrant/hosts/linux_test.rb +3 -5
  166. data/test/vagrant/plugin_test.rb +9 -0
  167. data/test/vagrant/provisioners/base_test.rb +1 -1
  168. data/test/vagrant/provisioners/chef_server_test.rb +31 -35
  169. data/test/vagrant/provisioners/chef_solo_test.rb +1 -1
  170. data/test/vagrant/provisioners/chef_test.rb +7 -7
  171. data/test/vagrant/ssh_session_test.rb +3 -10
  172. data/test/vagrant/ssh_test.rb +25 -33
  173. data/test/vagrant/systems/linux_test.rb +6 -71
  174. data/test/vagrant/ui_test.rb +29 -0
  175. data/test/vagrant/util/hash_with_indifferent_access_test.rb +39 -0
  176. data/test/vagrant/util/resource_logger_test.rb +14 -81
  177. data/test/vagrant/util/retryable_test.rb +38 -0
  178. data/test/vagrant/util/template_renderer_test.rb +4 -4
  179. data/test/vagrant/vm_test.rb +47 -26
  180. data/vagrant.gemspec +14 -12
  181. metadata +121 -89
  182. data/bin/.gitignore +0 -0
  183. data/lib/vagrant/action/action_exception.rb +0 -16
  184. data/lib/vagrant/action/env/error_halt.rb +0 -16
  185. data/lib/vagrant/action/exception_catcher.rb +0 -14
  186. data/lib/vagrant/action/vm/persist.rb +0 -22
  187. data/lib/vagrant/active_list.rb +0 -83
  188. data/lib/vagrant/command.rb +0 -27
  189. data/lib/vagrant/commands/base.rb +0 -181
  190. data/lib/vagrant/commands/box.rb +0 -16
  191. data/lib/vagrant/commands/box/add.rb +0 -30
  192. data/lib/vagrant/commands/box/list.rb +0 -30
  193. data/lib/vagrant/commands/box/remove.rb +0 -30
  194. data/lib/vagrant/commands/box/repackage.rb +0 -35
  195. data/lib/vagrant/commands/destroy.rb +0 -37
  196. data/lib/vagrant/commands/halt.rb +0 -43
  197. data/lib/vagrant/commands/init.rb +0 -36
  198. data/lib/vagrant/commands/package.rb +0 -81
  199. data/lib/vagrant/commands/provision.rb +0 -31
  200. data/lib/vagrant/commands/reload.rb +0 -36
  201. data/lib/vagrant/commands/resume.rb +0 -35
  202. data/lib/vagrant/commands/ssh.rb +0 -78
  203. data/lib/vagrant/commands/ssh_config.rb +0 -45
  204. data/lib/vagrant/commands/status.rb +0 -125
  205. data/lib/vagrant/commands/suspend.rb +0 -36
  206. data/lib/vagrant/commands/up.rb +0 -44
  207. data/lib/vagrant/exceptions/uncallable_action.rb +0 -17
  208. data/lib/vagrant/util/translator.rb +0 -35
  209. data/templates/strings.yml +0 -341
  210. data/templates/unison/crontab_entry.erb +0 -1
  211. data/templates/unison/script.erb +0 -71
  212. data/test/vagrant/action/env/error_halt_test.rb +0 -21
  213. data/test/vagrant/action/exception_catcher_test.rb +0 -30
  214. data/test/vagrant/action/vm/persist_test.rb +0 -50
  215. data/test/vagrant/active_list_test.rb +0 -173
  216. data/test/vagrant/command_test.rb +0 -53
  217. data/test/vagrant/commands/base_test.rb +0 -139
  218. data/test/vagrant/commands/box/add_test.rb +0 -34
  219. data/test/vagrant/commands/box/list_test.rb +0 -32
  220. data/test/vagrant/commands/box/remove_test.rb +0 -41
  221. data/test/vagrant/commands/box/repackage_test.rb +0 -52
  222. data/test/vagrant/commands/destroy_test.rb +0 -44
  223. data/test/vagrant/commands/halt_test.rb +0 -50
  224. data/test/vagrant/commands/init_test.rb +0 -71
  225. data/test/vagrant/commands/package_test.rb +0 -97
  226. data/test/vagrant/commands/provision_test.rb +0 -60
  227. data/test/vagrant/commands/reload_test.rb +0 -47
  228. data/test/vagrant/commands/resume_test.rb +0 -44
  229. data/test/vagrant/commands/ssh_config_test.rb +0 -77
  230. data/test/vagrant/commands/ssh_test.rb +0 -129
  231. data/test/vagrant/commands/status_test.rb +0 -40
  232. data/test/vagrant/commands/suspend_test.rb +0 -44
  233. data/test/vagrant/commands/up_test.rb +0 -49
  234. data/test/vagrant/util/translator_test.rb +0 -61
  235. data/test/vagrant/util_test.rb +0 -27
@@ -0,0 +1,13 @@
1
+ Vagrant::Config.run do |config|
2
+ # All Vagrant configuration is done here. For a detailed explanation
3
+ # and listing of configuration options, please view the documentation
4
+ # online.
5
+
6
+ # Every Vagrant virtual environment requires a box to build off of.
7
+ config.vm.box = "<%= box_name %>"
8
+ <% if !box_url.nil? %>
9
+
10
+ # The url from where the 'config.vm.box' box will be fetched if it
11
+ # doesn't already exist on the user's system
12
+ config.vm.box_url = "<%= box_url %>"<% end %>
13
+ end
@@ -0,0 +1,7 @@
1
+ <% errors.each do |key, container| -%>
2
+ <%= key %>:
3
+ <% container.errors.each do |error| -%>
4
+ * <%= error %>
5
+ <% end -%>
6
+
7
+ <% end -%>
@@ -0,0 +1,402 @@
1
+ en:
2
+ vagrant:
3
+ general:
4
+ creating_home_dir: "Creating home directory since it doesn't exist: %{directory}"
5
+
6
+ #-------------------------------------------------------------------------------
7
+ # Translations for exception classes
8
+ #-------------------------------------------------------------------------------
9
+ errors:
10
+ base_vm_not_found: The base VM with the name '%{name}' was not found.
11
+ box_not_found: Box '%{name}' could not be found.
12
+ cli_missing_env: This command requires that a Vagrant environment be properly passed in as the last parameter.
13
+ config_validation: |-
14
+ There was a problem with the configuration of Vagrant. The error message(s)
15
+ are printed below:
16
+
17
+ %{messages}
18
+ interrupted: Vagrant exited after cleanup due to external interrupt.
19
+ multi_vm_required: A multi-vm environment is required for name specification to this command.
20
+ multi_vm_target_required: `vagrant %{command}` requires a specific VM name to target in a multi-VM environment.
21
+ no_env: No Vagrant environment detected. Run `vagrant init` to set one up.
22
+ ssh_authentication_failed: |-
23
+ SSH authentication failed! This is typically caused by the public/private
24
+ keypair for the SSH user not being properly set on the guest VM. Please
25
+ verify that the guest VM is setup with the proper public key, and that
26
+ the private key path for Vagrant is setup properly as well.
27
+ ssh_bad_exit_status: |-
28
+ The following SSH command responded with a non-zero exit status.
29
+ Vagrant assumes that this means the command failed!
30
+
31
+ %{command}
32
+ ssh_connection_refused: |-
33
+ SSH connection was refused! This usually happens if the VM failed to
34
+ boot properly. Some steps to try to fix this: First, try reloading your
35
+ VM with `vagrant reload`, since a simple restart sometimes fixes things.
36
+ If that doesn't work, destroy your VM and recreate it with a `vagrant destroy`
37
+ followed by a `vagrant up`. If that doesn't work, contact a Vagrant
38
+ maintainer (support channels listed on the website) for more assistance.
39
+ ssh_key_bad_permissions: |-
40
+ The private key to connect to this box via SSH has invalid permissions
41
+ set on it. The permissions of the private key should be set to 0600, otherwise SSH will
42
+ ignore the key. Vagrant tried to do this automatically for you but failed. Please set the
43
+ permissions on the following file to 0600 and then try running this command again:
44
+
45
+ %{key_path}
46
+ ssh_unavailable_windows: |-
47
+ `vagrant ssh` isn't available on the Windows platform. The
48
+ vagrant.ppk file for use with Putty is available at:
49
+
50
+ %{key_path}.ppk
51
+
52
+ To use this create a new Putty session for `vagrant@localhost`
53
+ on port `%{ssh_port}`, in the Connection>SSH>Auth
54
+ configuration section navigate to the vagrant.ppk file,
55
+ select it, save the session for later use, and connect.
56
+
57
+ For a more detailed guide please consult:
58
+
59
+ http://vagrantup.com/docs/getting-started/windows.
60
+
61
+ system:
62
+ invalid_class: |-
63
+ The specified system does not inherit from `Vagrant::Systems::Base`. The
64
+ specified system class must inherit from this class.
65
+
66
+ The specified system class was: %{system}
67
+ unknown_type: |-
68
+ The specified system type is unknown: %{system}. Please change this
69
+ to a proper value.
70
+ unspecified: |-
71
+ A VM system type must be specified! This is done via the `config.vm.system`
72
+ configuration value. Please read the documentation online for more information.
73
+ vagrantfile_syntax_error: |-
74
+ There is a syntax error in the following Vagrantfile. The syntax error
75
+ message is reproduced below for convenience:
76
+
77
+ %{file}
78
+ virtualbox_invalid_ose: |-
79
+ Vagrant has detected you're using an OSE ("Open Source Edition") of VirtualBox.
80
+ Vagrant currently doesn't support any of the OSE editions due to slight API
81
+ differences. Please download the regular package from virtualbox.org and install
82
+ to continue.
83
+ virtualbox_invalid_version: |-
84
+ Vagrant has detected that you have VirtualBox version %{version} installed!
85
+ Vagrant requires that you use at least VirtualBox version 3.2. Please install
86
+ a more recent version of VirtualBox to continue.
87
+ virtualbox_not_detected: |-
88
+ Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
89
+ If VirtualBox is installed, it may be an incorrect version. Vagrant currently
90
+ requires VirtualBox 3.2.x. Please install the proper version to continue.
91
+ vm_creation_required: VM must be created before running this command. Run `vagrant up` first.
92
+ vm_not_found: A VM by the name of %{name} was not found.
93
+
94
+ #-------------------------------------------------------------------------------
95
+ # Translations for config validation errors
96
+ #-------------------------------------------------------------------------------
97
+ config:
98
+ common:
99
+ error_empty: `%{field}` must be filled in.
100
+ ssh:
101
+ private_key_missing: "`private_key_path` file must exist: %{path}"
102
+ vm:
103
+ shared_folder_hostpath_missing: "Shared folder host path for '%{name}' doesn't exist: %{path}"
104
+ boot_mode_invalid: "Boot mode must be one of: vrdp or gui"
105
+
106
+ #-------------------------------------------------------------------------------
107
+ # Translations for commands. e.g. `vagrant x`
108
+ #-------------------------------------------------------------------------------
109
+ commands:
110
+ common:
111
+ vm_not_created: "VM not created. Moving on..."
112
+ box:
113
+ no_installed_boxes: "There are no installed boxes! Use `vagrant box add` to add some."
114
+ ssh:
115
+ execute: "Execute: %{command}"
116
+ status:
117
+ output: |-
118
+ Current VM states:
119
+
120
+ %{states}
121
+
122
+ %{message}
123
+ not_created: |-
124
+ The environment has not yet been created. Run `vagrant up` to
125
+ create the environment.
126
+ powered_off: The VM is powered off. To restart the VM, simply run `vagrant up`
127
+ running: |-
128
+ The VM is running. To stop this VM, you can run `vagrant halt` to
129
+ shut it down forcefully, or you can run `vagrant suspend` to simply
130
+ suspend the virtual machine. In either case, to restart it again,
131
+ simply run `vagrant up`.
132
+ saved: To resume this VM, simply run `vagrant up`.
133
+ listing: |-
134
+ This environment represents multiple VMs. The VMs are all listed
135
+ above with their current state. For more information about a specific
136
+ VM, run `vagrant status NAME`.
137
+ up:
138
+ vm_created: "VM already created. Booting if its not already running..."
139
+ upgrade_to_060:
140
+ already_done: "Environment appears to already be upgraded to 0.6.0. Doing nothing!"
141
+ ask: "Are you sure you want to execute this command?"
142
+ backing_up: "Backing up previous .vagrant file..."
143
+ complete: "Environment upgraded to 0.6.0 successfully."
144
+ info: |-
145
+ This command will upgrade the current environment from a pre-0.6.0
146
+ environment to a 0.6.x compatible environment. Running this command
147
+ multiple times should be okay. This command will make a backup file
148
+ prior to making any changes. Therefore, if anything goes wrong, then
149
+ restore that file to ".vagrant" in the same directory as the Vagrantfile.
150
+ quit: "Not executing this command by user request. Quitting..."
151
+ version:
152
+ output: "Vagrant version %{version}"
153
+
154
+ #-------------------------------------------------------------------------------
155
+ # Translations for Vagrant middleware acions
156
+ #-------------------------------------------------------------------------------
157
+ actions:
158
+ runner:
159
+ waiting_cleanup: "Waiting for cleanup before exiting..."
160
+ exit_immediately: "Exiting immediately, without cleanup!"
161
+ vm:
162
+ boot:
163
+ booting: Booting VM...
164
+ waiting: Waiting for VM to boot. This can take a few minutes.
165
+ ready: VM booted and ready for use!
166
+ failed: Failed to connect to VM!
167
+ failed_to_boot: VM failed to boot.
168
+ check_box:
169
+ not_found: Box %{name} was not found. Fetching box from specified URL...
170
+ not_specified: |-
171
+ No base box was specified! A base box is required as a staring point
172
+ for every vagrant virtual machine. Please specify one in your Vagrantfile
173
+ using `config.vm.box`
174
+ does_not_exist: |-
175
+ Specified box `%{name}` does not exist!
176
+
177
+ The box must be added through the `vagrant box add` command. Please view
178
+ the documentation associated with the command for more information.
179
+ check_guest_additions:
180
+ not_detected: |-
181
+ No guest additions were detected on the base box for this VM! Guest
182
+ additions are required for forwarded ports, shared folders, host only
183
+ networking, and more. If SSH fails on this machine, please install
184
+ the guest additions and repackage the box to continue.
185
+
186
+ This is not an error message; everything may continue to work properly,
187
+ in which case you may ignore this message.
188
+ version_mismatch: |-
189
+ The guest additions on this VM do not match the install version of
190
+ VirtualBox! This may cause things such as forwarded ports, shared
191
+ folders, and more to not work properly. If any of those things fail on
192
+ this machine, please update the guest additions and repackage the
193
+ box.
194
+
195
+ Guest Additions Version: %{guest_version}
196
+ VirtualBox Version: %{virtualbox_version}
197
+ clear_forward_ports:
198
+ deleting: Clearing any previously set forwarded ports...
199
+ clear_shared_folders:
200
+ deleting: Cleaning previously set shared folders...
201
+ customize:
202
+ running: Running any VM customizations...
203
+ destroy:
204
+ destroying: Destroying VM and associated drives...
205
+ destroy_network:
206
+ destroying: Destroying unused networking interface...
207
+ disable_networks:
208
+ disabling: Disabling host only networks...
209
+ discard_state:
210
+ discarding: Discarding saved state of VM...
211
+ export:
212
+ create_dir: Creating temporary directory for export...
213
+ exporting: Exporting VM...
214
+ power_off: "The Vagrant virtual environment you are trying to package must be powered off."
215
+ forward_ports:
216
+ auto_empty: |-
217
+ Vagrant found a port collision for the specified port and virtual machine.
218
+ While this port was marked to be auto-corrected, the ports in the
219
+ auto-correction range are all also used.
220
+
221
+ VM: %{vm_name}
222
+ Forwarded port: %{name} (%{guest_port} => %{host_port})
223
+ below_threshold_error: |-
224
+ The host port of all forwarded ports must be above 1024. VirtualBox
225
+ does not allow host ports to be below 1024. (Guest ports below 1024
226
+ are fine. For example: SSH on port 22 on the guest can be forwarded
227
+ to port 2222, but not 222).
228
+ collision_error: |-
229
+ Vagrant cannot forward the specified ports on this VM, since they
230
+ would collide with another VirtualBox virtual machine's forwarded
231
+ ports! The '%{name}' forwarded port (%{host_port}) is already in use on the host
232
+ machine.
233
+
234
+ To fix this, modify your current projects Vagrantfile to use another
235
+ port. Example, where '1234' would be replaced by a unique host port:
236
+
237
+ config.vm.forward_port("%{name}", %{guest_port}, 1234)
238
+
239
+ fixed_collision: Fixed port collision '%{name}'. Now on port %{new_port}.
240
+ forwarding: Forwarding ports...
241
+ forwarding_entry: "-- %{name}: %{guest_port} => %{host_port} (adapter %{adapter})"
242
+ non_nat: |-
243
+ VirtualBox adapter #%{adapter} not configured as "NAT"
244
+ Skipping port forwarding '%{name}'.
245
+ halt:
246
+ force: Forcing shutdown of VM...
247
+ import:
248
+ importing: Importing base box '%{name}'...
249
+ failure: |-
250
+ The VM import failed! Try running `VBoxManage import` on the box file
251
+ manually for more verbose error output.
252
+ match_mac:
253
+ matching: Matching MAC address for NAT networking...
254
+ network:
255
+ collides: |-
256
+ The specified host network collides with a non-hostonly network!
257
+ This will cause your specified IP to be inaccessible. Please change
258
+ the IP or name of your host only network to not match that of
259
+ a bridged or non-hostonly network.
260
+ creating: Creating new host only network for environment...
261
+ enabling: Enabling host only network...
262
+ not_found: |-
263
+ The specified host network could not be found: '%{name}.'
264
+ If the name specification is removed, Vagrant will create a new
265
+ host only network for you. Alternatively, please create the
266
+ specified network manually.
267
+ preparing: Preparing host only network...
268
+ nfs:
269
+ host_required: |-
270
+ A host class is required for NFS shared folders. By default, these
271
+ are auto-detected, but can be overridden with `config.vagrant.host`.
272
+ There is currently not host class loaded.
273
+ no_host_network: |-
274
+ NFS shared folders requires that host only networking is enabled.
275
+ Please enable host only networking via `config.vm.network`.
276
+ not_supported: |-
277
+ The host class is reporting that NFS is not supported by this host,
278
+ or `nfsd` may not be installed. Please verify that `nfsd` is installed
279
+ on your machine, and retry.
280
+ exporting: Exporting NFS shared folders...
281
+ mounting: Mounting NFS shared folders...
282
+ persist:
283
+ dotfile_error: |-
284
+ The dotfile which Vagrant uses to store the UUID of the project's
285
+ virtual machine already exists and is not a file! The dotfile is
286
+ currently configured to be '%{dotfile_path}'
287
+
288
+ To change this value, please see `config.vagrant.dotfile_name`
289
+
290
+ Are you trying to use Vagrant from your home directory? This is the
291
+ leading cause of this error message. To resolve this, simply use a
292
+ different directory. Or, if you really want to run Vagrant from your
293
+ home directory, modify the `config.vagrant.dotfile_name` configuration
294
+ key.
295
+ persisting: "Persisting the VM UUID (%{uuid})..."
296
+ provision:
297
+ beginning: "Beginning provisioning process..."
298
+ enabled: "Provisioning enabled with %{provisioner}..."
299
+ invalid_class: "Provisioners must be an instance of Vagrant::Provisioners::Base"
300
+ unknown_type: "Unknown provisioner type: %{provisioner}"
301
+ resume:
302
+ resuming: Resuming suspended VM...
303
+ share_folders:
304
+ creating: Creating shared folders metadata...
305
+ mounting: Mounting shared folders...
306
+ mounting_entry: "-- %{name}: %{guest_path}"
307
+ suspend:
308
+ suspending: Saving VM state and suspending execution...
309
+
310
+ box:
311
+ destroy:
312
+ destroying: "Deleting box '%{name}'..."
313
+ download:
314
+ with: "Downloading with %{class}..."
315
+ cleaning: "Cleaning up downloaded box..."
316
+ copying: "Copying box to temporary location..."
317
+ unknown_type: "Unknown or unsupported URI type given for box download."
318
+ unpackage:
319
+ extracting: "Extracting box..."
320
+ already_exists: |-
321
+ A box already exists under the name of '%{name}'. This may or may
322
+ not be the same box you are trying to add. Please use another name
323
+ or remove the previous box then try to add it again.
324
+ verify:
325
+ verifying: "Verifying box..."
326
+ failed: |-
327
+ The box file you're attempting to add is invalid. This can be
328
+ commonly attributed to typos in the path given to the box add
329
+ command. Another common case of this is invalid packaging of the
330
+ box itself.
331
+
332
+ general:
333
+ package:
334
+ packaging: "Packaging additional file: %{file}"
335
+ compressing: "Compressing package to: %{tar_path}"
336
+ output_exists: |-
337
+ The specified file to save the package as already exists. Please
338
+ remove this file or specify a different file name for outputting.
339
+ requires_directory: |-
340
+ A directory was not specified to package. This should never happen
341
+ and is a result of an internal inconsistency.
342
+ include_file_missing: |-
343
+ Package include file doesn't exist: %{file}
344
+
345
+ downloaders:
346
+ file:
347
+ file_missing: "The specified path to a file doesn't exist."
348
+ http:
349
+ socket_error: |-
350
+ An error occurred while trying to download the specified box. This most
351
+ often happens if there is no internet connection or the address is
352
+ invalid.
353
+
354
+ hosts:
355
+ bsd:
356
+ nfs_export:
357
+ prepare: "Preparing to edit /etc/exports. Administrator privileges will be required..."
358
+ linux:
359
+ nfs_export:
360
+ prepare: "Preparing to edit /etc/exports. Administrator privileges will be required..."
361
+
362
+ provisioners:
363
+ chef:
364
+ json: "Generating chef JSON and uploading..."
365
+ client_key_folder: "Creating folder to hold client key..."
366
+ upload_validation_key: "Uploading chef client validation key..."
367
+ running_client: "Running chef-client..."
368
+ running_solo: "Running chef-solo..."
369
+ invalid_provisioner: "Vagrant::Provisioners::Chef is not a valid provisioner! Use ChefSolo or ChefServer instead."
370
+ not_detected: |-
371
+ The `%{binary}` binary appears to not be in the PATH of the guest. This
372
+ could be because the PATH is not properly setup or perhaps chef is not
373
+ installed on this guest. Chef provisioning can not continue without
374
+ chef properly installed.
375
+ server_url_required: |-
376
+ Chef server provisioning requires that the `config.chef.chef_server_url` be set to the
377
+ URL of your chef server. Examples include "http://12.12.12.12:4000" and
378
+ "http://myserver.com:4000" (the port of course can be different, but 4000 is the default)
379
+ server_validation_key_required: |-
380
+ Chef server provisioning requires that the `config.chef.validation_key_path` configuration
381
+ be set to a path on your local machine of the validation key used to register the
382
+ VM with the chef server.
383
+ server_validation_key_doesnt_exist: |-
384
+ The validation key set for `config.chef.validation_key_path` does not exist! This
385
+ file needs to exist so it can be uploaded to the virtual machine.
386
+
387
+ systems:
388
+ linux:
389
+ attempting_halt: "Attempting graceful shutdown of linux..."
390
+ mount_fail: "Failed to mount shared folders. `vboxsf` was not available."
391
+ network_not_debian: |-
392
+ Host only networking is only supported for Debian/Ubuntu by the built-in
393
+ "Linux" system. If you're using some other distro and want to implement
394
+ host only networking, please subclass the `Vagrant::Systems::Linux` class
395
+ and implement the `prepare_host_only_network` and `enable_host_only_network`
396
+ methods.
397
+
398
+ Otherwise, please report your distro and how to modify network interfaces
399
+ to the Vagrant mailing list or IRC and we'll probably be glad to add it
400
+ to the internal systems.
401
+ solaris:
402
+ attempting_halt: "Attempting graceful shutdown of solaris..."
@@ -7,5 +7,5 @@ end
7
7
 
8
8
  # Load include vagrant file if it exists after the auto-generated
9
9
  # so it can override any of the settings
10
- include_vagrantfile = File.expand_path(File.join(File.dirname(__FILE__), "include", "Vagrantfile"))
10
+ include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
11
11
  load include_vagrantfile if File.exist?(include_vagrantfile)
@@ -0,0 +1,8 @@
1
+ en:
2
+ vagrant:
3
+ test:
4
+ errors:
5
+ test_key: This is a test key
6
+ test_key_with_interpolation: This is a test key that says %{key}
7
+ alternate:
8
+ test_key: This is an alternate
data/test/test_helper.rb CHANGED
@@ -1,127 +1,43 @@
1
- # ruby-debug, not necessary, but useful if we have it
2
- begin
3
- require 'ruby-debug'
4
- rescue LoadError; end
5
-
6
- require File.join(File.dirname(__FILE__), '..', 'lib', 'vagrant')
7
- require 'contest'
8
- require 'mocha'
9
-
10
1
  # Add this folder to the load path for "test_helper"
11
2
  $:.unshift(File.dirname(__FILE__))
12
3
 
13
- class Test::Unit::TestCase
14
- # Mocks an environment, setting it up with the given config.
15
- def mock_environment
16
- environment = Vagrant::Environment.new
17
-
18
- Vagrant::Config.reset!(environment)
19
-
20
- Vagrant::Config.run do |config|
21
- config.vagrant.home = '~/.home'
22
- config.vagrant.dotfile_name = ".vagrant"
23
- config.vagrant.log_output = nil
24
- config.vagrant.host = :detect
25
-
26
- config.ssh.username = "foo"
27
- config.ssh.host = "baz"
28
- config.ssh.port = 22
29
- config.ssh.forwarded_port_key = "ssh"
30
- config.ssh.max_tries = 10
31
- config.ssh.timeout = 10
32
- config.ssh.private_key_path = '~/foo'
33
-
34
- config.vm.box = "foo"
35
- config.vm.box_url = nil
36
- config.vm.box_ovf = "box.ovf"
37
- config.vm.base_mac = "42"
38
- config.vm.disk_image_format = 'VMDK'
39
- config.vm.forward_port("ssh", 22, 2222)
40
- config.vm.shared_folder_uid = nil
41
- config.vm.shared_folder_gid = nil
42
- config.vm.system = :linux
43
- config.vm.share_folder("v-root", "/vagrant", ".")
44
-
45
- config.package.name = 'package'
46
-
47
- # Unison
48
- config.unison.folder_suffix = ".sync"
49
- config.unison.log_file = "foo-%s"
50
-
51
- # Chef
52
- config.chef.chef_server_url = "http://localhost:4000"
53
- config.chef.validation_key_path = "validation.pem"
54
- config.chef.client_key_path = "/zoo/foo/bar.pem"
55
- config.chef.node_name = "baz"
56
- config.chef.recipe_url = nil
57
- config.chef.cookbooks_path = "cookbooks"
58
- config.chef.provisioning_path = "/tmp/vagrant-chef"
59
- config.chef.log_level = :info
60
- config.chef.json = {
61
- :recipes => ["vagrant_main"]
62
- }
63
- end
64
-
65
- if block_given?
66
- Vagrant::Config.run do |config|
67
- yield config
68
- end
69
- end
4
+ require 'vagrant'
5
+ require 'mario'
6
+ require 'contest'
7
+ require 'mocha'
70
8
 
71
- config = Vagrant::Config.execute!
9
+ # Try to load ruby debug since its useful if it is available.
10
+ # But not a big deal if its not available (probably on a non-MRI
11
+ # platform)
12
+ begin
13
+ require 'ruby-debug'
14
+ rescue LoadError
15
+ end
72
16
 
73
- environment.instance_variable_set(:@config, config)
17
+ # Silence Mario by sending log output to black hole
18
+ Mario::Platform.logger(nil)
74
19
 
75
- # Setup the logger. We create it then reset it so that subsequent
76
- # calls will recreate it for us.
77
- environment.load_logger!
78
- environment.logger.class.reset_singleton_logger!
79
- environment.logger.stubs(:flush_progress)
80
- environment.logger.stubs(:cl_reset).returns("")
20
+ # Add the I18n locale for tests
21
+ I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
81
22
 
82
- environment
83
- end
23
+ class Test::Unit::TestCase
24
+ include Vagrant::TestHelpers
84
25
 
85
26
  # Sets up the mocks for a VM
86
27
  def mock_vm(env=nil)
87
- env ||= mock_environment
28
+ env ||= vagrant_env
88
29
  vm = Vagrant::VM.new
89
30
  vm.stubs(:env).returns(env)
90
31
  vm.stubs(:ssh).returns(Vagrant::SSH.new(vm.env))
91
32
  vm
92
33
  end
93
34
 
94
- def mock_action_data
95
- app = lambda { |env| }
96
- env = Vagrant::Action::Environment.new(mock_environment)
97
- env["vagrant.test"] = true
98
- [app, env]
99
- end
100
-
101
- # Returns a resource logger which is safe for tests
102
- def quiet_logger(resource, env=nil)
103
- logger = Vagrant::ResourceLogger.new(resource, env)
104
- logger.stubs(:flush_progress)
105
- logger.stubs(:cl_reset).returns("")
106
- logger
107
- end
108
-
109
- # Returns a linux system
110
- def linux_system(vm)
111
- Vagrant::Systems::Linux.new(vm)
112
- end
113
-
114
- def stub_default_action_dependecies(mock)
115
- mock.stubs(:precedes).returns([])
116
- mock.stubs(:follows).returns([])
117
- end
118
-
119
35
  # Sets up the mocks and stubs for a downloader
120
36
  def mock_downloader(downloader_klass)
121
37
  tempfile = mock("tempfile")
122
38
  tempfile.stubs(:write)
123
39
 
124
- _, env = mock_action_data
40
+ _, env = action_env
125
41
  [downloader_klass.new(env), tempfile]
126
42
  end
127
43
  end