vagrant 2.4.4 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -1
  3. data/lib/vagrant/action/builtin/box_add.rb +51 -7
  4. data/lib/vagrant/action/builtin/cloud_init_setup.rb +56 -15
  5. data/lib/vagrant/action/builtin/cloud_init_wait.rb +28 -10
  6. data/lib/vagrant/action/builtin/disk.rb +4 -1
  7. data/lib/vagrant/box_metadata.rb +8 -2
  8. data/lib/vagrant/bundler.rb +8 -6
  9. data/lib/vagrant/errors.rb +16 -0
  10. data/lib/vagrant/util/file_checksum.rb +59 -50
  11. data/lib/vagrant/util/mime.rb +1 -1
  12. data/plugins/commands/autocomplete/command/root.rb +8 -10
  13. data/plugins/commands/box/command/root.rb +10 -12
  14. data/plugins/commands/cloud/auth/root.rb +10 -12
  15. data/plugins/commands/cloud/box/root.rb +10 -12
  16. data/plugins/commands/cloud/provider/root.rb +10 -12
  17. data/plugins/commands/cloud/root.rb +10 -12
  18. data/plugins/commands/cloud/version/root.rb +10 -12
  19. data/plugins/commands/plugin/command/root.rb +10 -12
  20. data/plugins/communicators/none/communicator.rb +46 -0
  21. data/plugins/communicators/none/plugin.rb +26 -0
  22. data/plugins/hosts/windows/cap/fs_iso.rb +25 -3
  23. data/plugins/kernel_v2/config/vm.rb +3 -0
  24. data/plugins/providers/hyperv/action/import.rb +16 -2
  25. data/plugins/providers/hyperv/action.rb +2 -0
  26. data/plugins/providers/hyperv/scripts/import_vm.ps1 +8 -1
  27. data/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 +22 -0
  28. data/plugins/providers/virtualbox/action/network.rb +6 -3
  29. data/plugins/providers/virtualbox/action.rb +2 -11
  30. data/plugins/providers/virtualbox/driver/base.rb +5 -4
  31. data/plugins/providers/virtualbox/driver/meta.rb +1 -0
  32. data/plugins/providers/virtualbox/driver/version_4_0.rb +2 -0
  33. data/plugins/providers/virtualbox/driver/version_4_1.rb +2 -0
  34. data/plugins/providers/virtualbox/driver/version_4_2.rb +2 -0
  35. data/plugins/providers/virtualbox/driver/version_4_3.rb +2 -0
  36. data/plugins/providers/virtualbox/driver/version_5_0.rb +2 -0
  37. data/plugins/providers/virtualbox/driver/version_7_0.rb +23 -20
  38. data/templates/locales/en.yml +43 -0
  39. data/vagrant.gemspec +0 -3
  40. data/version.txt +1 -1
  41. metadata +4 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 224d3813ea9dced5e3fd7bdb4b333292f7457f9b66207e3bbe512ed842822e35
4
- data.tar.gz: 1e1829feabf687bdaa50321e59bca502f51edf028059812973d1e4a83cd2ea36
3
+ metadata.gz: 0626c2a374eefa0d6beab52f299d0d1ecaf4855ae7f53dc1a29bc4bb3372fb97
4
+ data.tar.gz: d37e2e061bfed1c565c87838f9810dbea194c73f64c61dc05be1e3da6c73740c
5
5
  SHA512:
6
- metadata.gz: 7dc6c1849cce484b599b8677c46d0e408239f72144996359adeb00ffba106566d7e191d11ce2c5c5e5e543091a6ef9fefabe975e5ed1b7a029bae54c222d0cde
7
- data.tar.gz: 55a468fd98862061b4d5d40492cc56cf4ffe712626fb1d4e0325d3db8744bdb097358e151b3d80b259eb804a96807c9ed61ed57dea85c6cdf16891b3787d8e2f
6
+ metadata.gz: 6c8598105fca1aa04c40df75a460115e94a6baf6731dc5d558e8cc3228e1f2e4894b085f0352f35bf3bcd11b0058007cdf7532044705903850729061fa1a87e7
7
+ data.tar.gz: b470ce0c8eefd4833999ab0f115ed224fac078b7362428e398b244dfeec73beb2a31371dfc4a2c2b57e52c2c6acad0b421690dd1e0f32da41f2bef59e7307845
data/CHANGELOG.md CHANGED
@@ -1,7 +1,33 @@
1
- ## 2.4.4 (April 21, 2025)
1
+ ## 2.4.6 (May 21, 2025)
2
+
3
+ IMPROVEMENTS:
4
+
5
+ - core: Improve error messages on box add failures [GH-13660]
6
+ - core: Only generate and attach ISO for cloud-init on first boot [GH-13666]
7
+ - host/windows: Add basic oscdimg detection on Windows [GH-13668]
8
+ - provider/hyperv: Enable cloud-init support [GH-13671]
9
+ - provider/virtualbox: Allow link-local IPv6 addresses for hostonly [GH-12653]
10
+
11
+ BUG FIXES:
12
+
13
+ - command: Remove server mode checks [GH-13657]
14
+ - core: Prevent cloud-init from regenerating and attaching ISO [GH-13666]
15
+ - provider/hyperv: Extract machine ID if collection returned [GH-13669]
16
+ - provider/hyperv: Fix import failure due to lack of resources [GH-13670]
17
+ - provider/virtualbox: Fix VirtualBox private network setup [GH-13659]
18
+
19
+ ## 2.4.5 (April 23, 2025)
2
20
 
3
21
  FEATURES:
4
22
 
23
+ - communicator/none: Add experimental none communicator [GH-13651]
24
+
25
+ BUG FIXES:
26
+
27
+ - core/bundler: Handle multiple versions for system specifications [GH-13652]
28
+
29
+ ## 2.4.4 (April 21, 2025)
30
+
5
31
  IMPROVEMENTS:
6
32
 
7
33
  - communicator/ssh: Update connect retry behavior, make configurable [GH-13628]
@@ -263,20 +263,64 @@ module Vagrant
263
263
  provider: provider,
264
264
  architecture: architecture,
265
265
  )
266
+
266
267
  if !metadata_version
267
- if provider && !metadata.version(">= 0", provider: provider, architecture: architecture)
268
- raise Errors::BoxAddNoMatchingProvider,
268
+ if provider
269
+ # If no version found that supports the provider, then the
270
+ # box has no support for the provider
271
+ if !metadata.version(">= 0", provider: provider)
272
+ raise Errors::BoxAddNoMatchingProvider,
273
+ name: metadata.name,
274
+ requested: Array(provider).join(", "),
275
+ url: display_url
276
+ end
277
+
278
+ # Get all versions that support the provider and architecture
279
+ available_versions = metadata.versions(
280
+ provider: provider,
281
+ architecture: architecture
282
+ )
283
+
284
+ # If no versions are found, then the box does not provide
285
+ # support for the requested architecture using the requested
286
+ # architecture
287
+ if available_versions.empty?
288
+ supported_providers = metadata.versions(architecture: architecture).map do |v|
289
+ metadata.version(v).providers(architecture)
290
+ end.compact.uniq.sort
291
+
292
+ # If no providers are found, then the box does not
293
+ # have any support for the requested architecture
294
+ if supported_providers.empty?
295
+ raise Errors::BoxAddNoArchitectureSupport,
296
+ architecture: display_architecture,
297
+ name: metadata.name,
298
+ url: display_url
299
+ end
300
+
301
+ raise Errors::BoxAddNoMatchingArchitecture,
302
+ provider: Array(provider).join(", "),
303
+ architecture: display_architecture,
304
+ name: metadata.name,
305
+ url: display_url,
306
+ supported_providers: supported_providers
307
+ end
308
+
309
+ raise Errors::BoxAddNoMatchingProviderVersion,
310
+ constraints: version || ">= 0",
311
+ provider: Array(provider).join(", "),
312
+ architecture: display_architecture,
269
313
  name: metadata.name,
270
- requested: [provider,
271
- display_architecture ? "(#{display_architecture})" : nil
272
- ].compact.join(" "),
273
- url: display_url
314
+ url: display_url,
315
+ versions: available_versions.reverse.join(", ")
274
316
  else
317
+ # Report that no version can match the constraints requested
318
+ # but show what versions are supported
275
319
  raise Errors::BoxAddNoMatchingVersion,
276
320
  constraints: version || ">= 0",
277
321
  name: metadata.name,
278
322
  url: display_url,
279
- versions: metadata.versions.join(", ")
323
+ versions: metadata.versions(architecture: architecture).reverse.join(", ")
280
324
  end
281
325
  end
282
326
 
@@ -16,16 +16,38 @@ module Vagrant
16
16
  end
17
17
 
18
18
  def call(env)
19
- machine = env[:machine]
19
+ catch(:complete) do
20
+ machine = env[:machine]
21
+
22
+ # The sentinel file in this check is written by the cloud init
23
+ # wait action and is only written after cloud init has completed.
24
+ @logger.info("Checking cloud-init sentinel file...")
25
+ sentinel_path = machine.data_dir.join("action_cloud_init")
26
+ if sentinel_path.file?
27
+ contents = sentinel_path.read.chomp
28
+ if machine.id.to_s == contents
29
+ if machine.config.vm.cloud_init_first_boot_only
30
+ @logger.info("Sentinel found for cloud-init, skipping")
31
+ throw :complete
32
+ else
33
+ @logger.info("Sentinel found for cloud-init but is configuration enabled")
34
+ end
35
+ else
36
+ @logger.debug("Found stale sentinel file, removing... (#{machine.id} != #{contents})")
37
+ end
38
+ sentinel_path.unlink
39
+ end
20
40
 
21
- user_data_configs = machine.config.vm.cloud_init_configs
22
- .select { |c| c.type == :user_data }
41
+ user_data_configs = machine.config.vm.cloud_init_configs.select { |c|
42
+ c.type == :user_data
43
+ }
23
44
 
24
- if !user_data_configs.empty?
25
- user_data = setup_user_data(machine, env, user_data_configs)
26
- meta_data = { "instance-id" => "i-#{machine.id.split('-').join}" }
45
+ if !user_data_configs.empty?
46
+ user_data = setup_user_data(machine, env, user_data_configs)
47
+ meta_data = { "instance-id" => "i-#{machine.id.split('-').join}" }
27
48
 
28
- write_cfg_iso(machine, env, user_data, meta_data)
49
+ write_cfg_iso(machine, env, user_data, meta_data)
50
+ end
29
51
  end
30
52
 
31
53
  # Continue On
@@ -88,24 +110,43 @@ module Vagrant
88
110
  # @param [Vagrant::Util::Mime::Multipart] user_data
89
111
  # @param [Hash] meta_data
90
112
  def write_cfg_iso(machine, env, user_data, meta_data)
91
- iso_path = nil
113
+ raise Errors::CreateIsoHostCapNotFound if !env[:env].host.capability?(:create_iso)
114
+
115
+ iso_path = catch(:iso_path) do
116
+ # This iso sentinel file is used to store the path of the
117
+ # generated iso file and its checksum. If the file does
118
+ # not exist, or the actual checksum of the file does not
119
+ # match that stored in the sentinel file, it is ignored
120
+ # and the iso is generated. This is used to prevent multiple
121
+ # iso file from being created over time.
122
+ iso_sentinel = env[:machine].data_dir.join("action_cloud_init_iso")
123
+ if iso_sentinel.file?
124
+ checksum, path = iso_sentinel.read.chomp.split(":", 2)
125
+ if File.exist?(path) && Vagrant::Util::FileChecksum.new(path, :sha256).checksum == checksum
126
+ throw :iso_path, Pathname.new(path)
127
+ end
128
+ iso_sentinel.unlink
129
+ end
92
130
 
93
- if env[:env].host.capability?(:create_iso)
94
131
  begin
95
132
  source_dir = Pathname.new(Dir.mktmpdir(TEMP_PREFIX))
96
133
  File.open("#{source_dir}/user-data", 'w') { |file| file.write(user_data.to_s) }
97
-
98
134
  File.open("#{source_dir}/meta-data", 'w') { |file| file.write(meta_data.to_yaml) }
99
135
 
100
- iso_path = env[:env].host.capability(:create_iso,
101
- source_dir, volume_id: "cidata")
102
- attach_disk_config(machine, env, iso_path.to_path)
136
+ env[:env].host.capability(
137
+ :create_iso,
138
+ source_dir,
139
+ volume_id: "cidata"
140
+ ).tap { |path|
141
+ checksum = Vagrant::Util::FileChecksum.new(path.to_path, :sha256).checksum
142
+ iso_sentinel.write("#{checksum}:#{path.to_path}")
143
+ }
103
144
  ensure
104
145
  FileUtils.remove_entry(source_dir)
105
146
  end
106
- else
107
- raise Errors::CreateIsoHostCapNotFound
108
147
  end
148
+
149
+ attach_disk_config(machine, env, iso_path.to_path)
109
150
  end
110
151
 
111
152
  # Adds a new :dvd disk config with the given iso_path to be attached
@@ -14,19 +14,37 @@ module Vagrant
14
14
  end
15
15
 
16
16
  def call(env)
17
- machine = env[:machine]
18
- cloud_init_wait_cmd = "cloud-init status --wait"
19
- if !machine.config.vm.cloud_init_configs.empty?
20
- if machine.communicate.test("command -v cloud-init")
21
- env[:ui].output(I18n.t("vagrant.cloud_init_waiting"))
22
- result = machine.communicate.sudo(cloud_init_wait_cmd, error_check: false)
23
- if result != 0
24
- raise Vagrant::Errors::CloudInitCommandFailed, cmd: cloud_init_wait_cmd, guest_name: machine.name
17
+ catch(:complete) do
18
+ machine = env[:machine]
19
+ sentinel_path = machine.data_dir.join("action_cloud_init")
20
+
21
+ @logger.info("Checking cloud-init sentinel file...")
22
+ if sentinel_path.file?
23
+ contents = sentinel_path.read.chomp
24
+ if machine.id.to_s == contents
25
+ @logger.info("Sentinel found for cloud-init, skipping")
26
+ throw :complete
25
27
  end
26
- else
27
- raise Vagrant::Errors::CloudInitNotFound, guest_name: machine.name
28
+ @logger.debug("Found stale sentinel file, removing... (#{machine.id} != #{contents})")
29
+ sentinel_path.unlink
28
30
  end
31
+
32
+ cloud_init_wait_cmd = "cloud-init status --wait"
33
+ if !machine.config.vm.cloud_init_configs.empty?
34
+ if machine.communicate.test("command -v cloud-init")
35
+ env[:ui].output(I18n.t("vagrant.cloud_init_waiting"))
36
+ result = machine.communicate.sudo(cloud_init_wait_cmd, error_check: false)
37
+ if result != 0
38
+ raise Vagrant::Errors::CloudInitCommandFailed, cmd: cloud_init_wait_cmd, guest_name: machine.name
39
+ end
40
+ else
41
+ raise Vagrant::Errors::CloudInitNotFound, guest_name: machine.name
42
+ end
43
+ end
44
+ # Write sentinel path
45
+ sentinel_path.write(machine.id.to_s)
29
46
  end
47
+
30
48
  @app.call(env)
31
49
  end
32
50
  end
@@ -27,7 +27,10 @@ module Vagrant
27
27
  end
28
28
  end
29
29
 
30
- write_disk_metadata(machine, configured_disks) unless configured_disks.empty?
30
+ # Always write the disk metadata even if the configured
31
+ # disks is empty. This ensure that old entries are not
32
+ # orphaned in the metadata file.
33
+ write_disk_metadata(machine, configured_disks)
31
34
 
32
35
  # Continue On
33
36
  @app.call(env)
@@ -49,6 +49,9 @@ module Vagrant
49
49
  #
50
50
  # @param [String] version The version to return, this can also
51
51
  # be a constraint.
52
+ # @option [Symbol, Array<Symbol>] :provider Provider filter
53
+ # @option [Symbol] :architecture Architecture filter
54
+ #
52
55
  # @return [Version] The matching version or nil if a matching
53
56
  # version was not found.
54
57
  def version(version, **opts)
@@ -90,10 +93,13 @@ module Vagrant
90
93
  # latest version. Optionally filter versions by a matching
91
94
  # provider.
92
95
  #
96
+ # @option [Symbol, Array<Symbol>] :provider Provider filter
97
+ # @option [Symbol] :architecture Architecture filter
98
+ #
93
99
  # @return[Array<String>]
94
100
  def versions(**opts)
95
101
  architecture = opts[:architecture]
96
- provider = opts[:provider].to_sym if opts[:provider]
102
+ provider = Array(opts[:provider]).map(&:to_sym) if opts[:provider]
97
103
 
98
104
  # Return full version list if no filters provided
99
105
  if provider.nil? && architecture.nil?
@@ -109,7 +115,7 @@ module Vagrant
109
115
  end
110
116
 
111
117
  @version_map.select { |_, version|
112
- version.provider(provider, architecture)
118
+ provider.any? { |pv| version.provider(pv, architecture) }
113
119
  }.keys.sort.map(&:to_s)
114
120
  end
115
121
 
@@ -549,8 +549,10 @@ module Vagrant
549
549
  @logger.debug("Disabling strict dependency enforcement")
550
550
  end
551
551
 
552
- @logger.debug("Dependency list for installation:\n - " \
553
- "#{plugin_deps.map{|d| "#{d.name} #{d.requirement}"}.join("\n - ")}")
552
+ dep_list = plugin_deps.sort_by(&:name).map { |d|
553
+ "#{d.name} #{d.requirement}"
554
+ }.join("\n - ")
555
+ @logger.debug("Dependency list for installation:\n - #{dep_list}")
554
556
 
555
557
  all_sources = source_list.values.flatten.uniq
556
558
  default_sources = DEFAULT_GEM_SOURCES & all_sources
@@ -680,11 +682,11 @@ module Vagrant
680
682
  directories = [spec_dir]
681
683
  if Vagrant.in_bundler?
682
684
  Gem::Specification.find_all{true}.each do |spec|
683
- list[spec.full_name] = spec
685
+ list[spec.name] = spec
684
686
  end
685
687
  else
686
688
  builtin_specs.each do |spec|
687
- list[spec.full_name] = spec
689
+ list[spec.name] = spec
688
690
  end
689
691
  end
690
692
  if Vagrant.in_installer?
@@ -693,8 +695,8 @@ module Vagrant
693
695
  end
694
696
  end
695
697
  Gem::Specification.each_spec(directories) do |spec|
696
- if !list[spec.full_name]
697
- list[spec.full_name] = spec
698
+ if !list[spec.name] || list[spec.name].version < spec.version
699
+ list[spec.name] = spec
698
700
  end
699
701
  end
700
702
  list.values
@@ -139,6 +139,18 @@ module Vagrant
139
139
  error_key(:box_add_no_matching_provider)
140
140
  end
141
141
 
142
+ class BoxAddNoArchitectureSupport < VagrantError
143
+ error_key(:box_add_no_architecture_support)
144
+ end
145
+
146
+ class BoxAddNoMatchingArchitecture < VagrantError
147
+ error_key(:box_add_no_matching_architecture)
148
+ end
149
+
150
+ class BoxAddNoMatchingProviderVersion < VagrantError
151
+ error_key(:box_add_no_matching_provider_version)
152
+ end
153
+
142
154
  class BoxAddNoMatchingVersion < VagrantError
143
155
  error_key(:box_add_no_matching_version)
144
156
  end
@@ -607,6 +619,10 @@ module Vagrant
607
619
  error_key(:no_env)
608
620
  end
609
621
 
622
+ class OscdimgCommandMissingError < VagrantError
623
+ error_key(:oscdimg_command_missing)
624
+ end
625
+
610
626
  class PackageIncludeMissing < VagrantError
611
627
  error_key(:include_file_missing, "vagrant.actions.general.package")
612
628
  end
@@ -13,65 +13,74 @@ class DigestClass
13
13
  def hexdigest; end
14
14
  end
15
15
 
16
- class FileChecksum
17
- BUFFER_SIZE = 1024 * 8
16
+ module Vagrant
17
+ module Util
18
+ class FileChecksum
19
+ BUFFER_SIZE = 1024 * 8
18
20
 
19
- # Supported file checksum
20
- CHECKSUM_MAP = {
21
- :md5 => Digest::MD5,
22
- :sha1 => Digest::SHA1,
23
- :sha256 => Digest::SHA256,
24
- :sha384 => Digest::SHA384,
25
- :sha512 => Digest::SHA512
26
- }.freeze
21
+ # Supported file checksum
22
+ CHECKSUM_MAP = {
23
+ :md5 => Digest::MD5,
24
+ :sha1 => Digest::SHA1,
25
+ :sha256 => Digest::SHA256,
26
+ :sha384 => Digest::SHA384,
27
+ :sha512 => Digest::SHA512
28
+ }.freeze
27
29
 
28
- # Initializes an object to calculate the checksum of a file. The given
29
- # ``digest_klass`` should implement the ``DigestClass`` interface. Note
30
- # that the built-in Ruby digest classes duck type this properly:
31
- # Digest::MD5, Digest::SHA1, etc.
32
- def initialize(path, digest_klass)
33
- if digest_klass.is_a?(Class)
34
- @digest_klass = digest_klass
35
- else
36
- @digest_klass = load_digest(digest_klass)
37
- end
30
+ # Initializes an object to calculate the checksum of a file. The given
31
+ # ``digest_klass`` should implement the ``DigestClass`` interface. Note
32
+ # that the built-in Ruby digest classes duck type this properly:
33
+ # Digest::MD5, Digest::SHA1, etc.
34
+ def initialize(path, digest_klass)
35
+ if digest_klass.is_a?(Class)
36
+ @digest_klass = digest_klass
37
+ else
38
+ @digest_klass = load_digest(digest_klass)
39
+ end
38
40
 
39
- @path = path
40
- end
41
+ @path = path
42
+ end
41
43
 
42
- # This calculates the checksum of the file and returns it as a
43
- # string.
44
- #
45
- # @return [String]
46
- def checksum
47
- digest = @digest_klass.new
48
- buf = ''
44
+ # This calculates the checksum of the file and returns it as a
45
+ # string.
46
+ #
47
+ # @return [String]
48
+ def checksum
49
+ digest = @digest_klass.new
50
+ buf = ''
49
51
 
50
- File.open(@path, "rb") do |f|
51
- while !f.eof
52
- begin
53
- f.readpartial(BUFFER_SIZE, buf)
54
- digest.update(buf)
55
- rescue EOFError
56
- # Although we check for EOF earlier, this seems to happen
57
- # sometimes anyways [GH-2716].
58
- break
52
+ File.open(@path, "rb") do |f|
53
+ while !f.eof
54
+ begin
55
+ f.readpartial(BUFFER_SIZE, buf)
56
+ digest.update(buf)
57
+ rescue EOFError
58
+ # Although we check for EOF earlier, this seems to happen
59
+ # sometimes anyways [GH-2716].
60
+ break
61
+ end
62
+ end
59
63
  end
60
- end
61
- end
62
64
 
63
- digest.hexdigest
64
- end
65
+ digest.hexdigest
66
+ end
65
67
 
66
- private
68
+ private
67
69
 
68
- def load_digest(type)
69
- digest = CHECKSUM_MAP[type.to_s.downcase.to_sym]
70
- if digest.nil?
71
- raise Vagrant::Errors::BoxChecksumInvalidType,
72
- type: type.to_s,
73
- types: CHECKSUM_MAP.keys.join(', ')
70
+ def load_digest(type)
71
+ digest = CHECKSUM_MAP[type.to_s.downcase.to_sym]
72
+ if digest.nil?
73
+ raise Vagrant::Errors::BoxChecksumInvalidType,
74
+ type: type.to_s,
75
+ types: CHECKSUM_MAP.keys.join(', ')
76
+ end
77
+ digest
78
+ end
74
79
  end
75
- digest
76
80
  end
77
81
  end
82
+
83
+ # NOTE: This class was not originally namespaced
84
+ # with the Util module so this is left for backwards
85
+ # compatibility.
86
+ FileChecksum = Vagrant::Util::FileChecksum
@@ -70,7 +70,7 @@ module Vagrant
70
70
  # @param [String] type of the entity content
71
71
  def initialize(content, content_type)
72
72
  if !MIME::Types.include?(content_type)
73
- MIME::Types.add(MIME::Type.new(content_type))
73
+ MIME::Types.add(MIME::Type.new("content-type" => content_type))
74
74
  end
75
75
  @content = content
76
76
  @content_type = MIME::Types[content_type].first
@@ -43,18 +43,16 @@ module VagrantPlugins
43
43
  def help
44
44
  opts = OptionParser.new do |opts|
45
45
  opts.banner = "Usage: vagrant autocomplete <subcommand>"
46
- if !Vagrant.server_mode?
47
- opts.separator ""
48
- opts.separator "Available subcommands:"
46
+ opts.separator ""
47
+ opts.separator "Available subcommands:"
49
48
 
50
- # Add the available subcommands as separators in order to print them
51
- # out as well.
52
- keys = []
53
- keys = @subcommands.keys.map(&:to_s)
49
+ # Add the available subcommands as separators in order to print them
50
+ # out as well.
51
+ keys = []
52
+ keys = @subcommands.keys.map(&:to_s)
54
53
 
55
- keys.sort.each do |key|
56
- opts.separator " #{key}"
57
- end
54
+ keys.sort.each do |key|
55
+ opts.separator " #{key}"
58
56
  end
59
57
 
60
58
  opts.separator ""
@@ -73,18 +73,16 @@ module VagrantPlugins
73
73
  def help
74
74
  opts = OptionParser.new do |opts|
75
75
  opts.banner = "Usage: vagrant box <subcommand> [<args>]"
76
- if !Vagrant.server_mode?
77
- opts.separator ""
78
- opts.separator "Available subcommands:"
79
-
80
- # Add the available subcommands as separators in order to print them
81
- # out as well.
82
- keys = []
83
- @subcommands.each { |key, value| keys << key.to_s }
84
-
85
- keys.sort.each do |key|
86
- opts.separator " #{key}"
87
- end
76
+ opts.separator ""
77
+ opts.separator "Available subcommands:"
78
+
79
+ # Add the available subcommands as separators in order to print them
80
+ # out as well.
81
+ keys = []
82
+ @subcommands.each { |key, value| keys << key.to_s }
83
+
84
+ keys.sort.each do |key|
85
+ opts.separator " #{key}"
88
86
  end
89
87
  opts.separator ""
90
88
  opts.separator "For help on any individual subcommand run `vagrant box <subcommand> -h`"
@@ -51,18 +51,16 @@ module VagrantPlugins
51
51
  opts.banner = "Usage: vagrant cloud auth <subcommand> [<args>]"
52
52
  opts.separator ""
53
53
  opts.separator "Authorization with Vagrant Cloud"
54
- if !Vagrant.server_mode?
55
- opts.separator ""
56
- opts.separator "Available subcommands:"
57
-
58
- # Add the available subcommands as separators in order to print them
59
- # out as well.
60
- keys = []
61
- @subcommands.each { |key, value| keys << key.to_s }
62
-
63
- keys.sort.each do |key|
64
- opts.separator " #{key}"
65
- end
54
+ opts.separator ""
55
+ opts.separator "Available subcommands:"
56
+
57
+ # Add the available subcommands as separators in order to print them
58
+ # out as well.
59
+ keys = []
60
+ @subcommands.each { |key, value| keys << key.to_s }
61
+
62
+ keys.sort.each do |key|
63
+ opts.separator " #{key}"
66
64
  end
67
65
  opts.separator ""
68
66
  opts.separator "For help on any individual subcommand run `vagrant cloud auth <subcommand> -h`"
@@ -55,18 +55,16 @@ module VagrantPlugins
55
55
  opts.banner = "Usage: vagrant cloud box <subcommand> [<args>]"
56
56
  opts.separator ""
57
57
  opts.separator "Commands to manage boxes on Vagrant Cloud"
58
- if !Vagrant.server_mode?
59
- opts.separator ""
60
- opts.separator "Available subcommands:"
61
-
62
- # Add the available subcommands as separators in order to print them
63
- # out as well.
64
- keys = []
65
- @subcommands.each { |key, value| keys << key.to_s }
66
-
67
- keys.sort.each do |key|
68
- opts.separator " #{key}"
69
- end
58
+ opts.separator ""
59
+ opts.separator "Available subcommands:"
60
+
61
+ # Add the available subcommands as separators in order to print them
62
+ # out as well.
63
+ keys = []
64
+ @subcommands.each { |key, value| keys << key.to_s }
65
+
66
+ keys.sort.each do |key|
67
+ opts.separator " #{key}"
70
68
  end
71
69
  opts.separator ""
72
70
  opts.separator "For help on any individual subcommand run `vagrant cloud box <subcommand> -h`"