vagrant 2.4.6 → 2.4.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0626c2a374eefa0d6beab52f299d0d1ecaf4855ae7f53dc1a29bc4bb3372fb97
4
- data.tar.gz: d37e2e061bfed1c565c87838f9810dbea194c73f64c61dc05be1e3da6c73740c
3
+ metadata.gz: a92c20e5a3d39c9d5da86eb148a11f8217cf57c7f8a248efd9837f3b74266022
4
+ data.tar.gz: de063590a0b3d8704def63c7f96f17400094034c8819cb69cadf9f2a7ae5cb38
5
5
  SHA512:
6
- metadata.gz: 6c8598105fca1aa04c40df75a460115e94a6baf6731dc5d558e8cc3228e1f2e4894b085f0352f35bf3bcd11b0058007cdf7532044705903850729061fa1a87e7
7
- data.tar.gz: b470ce0c8eefd4833999ab0f115ed224fac078b7362428e398b244dfeec73beb2a31371dfc4a2c2b57e52c2c6acad0b421690dd1e0f32da41f2bef59e7307845
6
+ metadata.gz: fa7ce2d66db74feb9271cb3cfec80bddc763bb03941093735fe30e9f77b80fc06b21108bf3c7b57b5bfa5cb1176f4d444231d24124dc5141ffcd9cdb65cb567d
7
+ data.tar.gz: bda8216b65f5493b51e9e3578b7e3636b40b717c6ecdcfbe13bdf5f87ea8e41eaa220cdedefdb78baba6d64bffa3e6e0d8ed2e730f5cb320e0ae8c4f71b787e4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.4.7 (June 17, 2025)
2
+
3
+ BUG FIXES:
4
+
5
+ - guests/linux: Fix /etc/fstab clean up behavior [GH-13681]
6
+ - provider/docker: Fix auto generated container names [GH-13678]
7
+ - provider/hyperv: Fix import for XML based configuration [GH-13674]
8
+
1
9
  ## 2.4.6 (May 21, 2025)
2
10
 
3
11
  IMPROVEMENTS:
@@ -64,9 +64,17 @@ module VagrantPlugins
64
64
  machine.communicate.test("test -f /etc/fstab")
65
65
  end
66
66
 
67
+ def self.contains_vagrant_data?(machine)
68
+ machine.communicate.test("grep '#VAGRANT-BEGIN' /etc/fstab")
69
+ end
70
+
67
71
  def self.remove_vagrant_managed_fstab(machine)
68
72
  if fstab_exists?(machine)
69
- machine.communicate.sudo("sed -i '/\#VAGRANT-BEGIN/,/\#VAGRANT-END/d' /etc/fstab")
73
+ if contains_vagrant_data?(machine)
74
+ machine.communicate.sudo("sed -i '/\#VAGRANT-BEGIN/,/\#VAGRANT-END/d' /etc/fstab")
75
+ else
76
+ @@logger.info("no vagrant data in fstab file, carrying on")
77
+ end
70
78
  else
71
79
  @@logger.info("no fstab file found, carrying on")
72
80
  end
@@ -91,9 +91,7 @@ module VagrantPlugins
91
91
  def create_params
92
92
  container_name = @provider_config.name
93
93
  if !container_name
94
- container_name = "#{@env[:root_path].basename.to_s}_#{@machine.name}"
95
- container_name.gsub!(/[^-a-z0-9_]/i, "")
96
- container_name << "_#{Time.now.to_i}"
94
+ container_name = generate_container_name
97
95
  end
98
96
 
99
97
  image = @env[:create_image]
@@ -156,6 +154,15 @@ module VagrantPlugins
156
154
 
157
155
  result
158
156
  end
157
+
158
+ def generate_container_name
159
+ container_name = "#{@env[:root_path].basename.to_s}_#{@machine.name}"
160
+ # Remove leading -/_ and any non-alphanumeric, non-hyphen/underscore characters
161
+ container_name.gsub!(/\A[^a-zA-Z0-9]+|[^-a-z0-9_]/i, "")
162
+ container_name << "_#{Time.now.to_i}"
163
+ container_name
164
+ end
165
+
159
166
  end
160
167
  end
161
168
  end
@@ -224,6 +224,12 @@ function New-VagrantVMXML {
224
224
  [string] $SourcePath,
225
225
  [parameter (Mandatory=$false)]
226
226
  [bool] $LinkedClone = $false,
227
+ [parameter (Mandatory=$false)]
228
+ [int] $Memory = $null,
229
+ [parameter (Mandatory=$false)]
230
+ [int] $MaxMemory = $null,
231
+ [parameter (Mandatory=$false)]
232
+ [int] $CPUCount = $null,
227
233
  [parameter(Mandatory=$false)]
228
234
  [string] $VMName
229
235
  )
@@ -327,7 +333,11 @@ function New-VagrantVMXML {
327
333
 
328
334
  # Apply original VM configuration to new VM instance
329
335
 
330
- $processors = $VMConfig.configuration.settings.processors.count."#text"
336
+ if($CPUCount -ne $null) {
337
+ $processors = $CPUCount
338
+ } else {
339
+ $processors = $VMConfig.configuration.settings.processors.count."#text"
340
+ }
331
341
  $notes = (Select-Xml -XML $VMConfig -XPath "//notes").node."#text"
332
342
  $memory = (Select-Xml -XML $VMConfig -XPath "//memory").node.Bank
333
343
  if ($memory.dynamic_memory_enabled."#text" -eq "True") {
@@ -336,10 +346,22 @@ function New-VagrantVMXML {
336
346
  else {
337
347
  $dynamicmemory = $False
338
348
  }
339
- # Memory values need to be in bytes
340
- $MemoryMaximumBytes = ($memory.limit."#text" -as [int]) * 1MB
341
- $MemoryStartupBytes = ($memory.size."#text" -as [int]) * 1MB
342
- $MemoryMinimumBytes = ($memory.reservation."#text" -as [int]) * 1MB
349
+
350
+
351
+ if($Memory -ne $null) {
352
+ $MemoryMaximumBytes = $Memory * 1MB
353
+ $MemoryStartupBytes = $Memory * 1MB
354
+ $MemoryMinimumBytes = $Memory * 1MB
355
+ } else {
356
+ $MemoryMaximumBytes = ($memory.limit."#text" -as [int]) * 1MB
357
+ $MemoryStartupBytes = ($memory.size."#text" -as [int]) * 1MB
358
+ $MemoryMinimumBytes = ($memory.reservation."#text" -as [int]) * 1MB
359
+ }
360
+
361
+ if($MaxMemory -ne $null) {
362
+ $dynamicmemory = $true
363
+ $MemoryMaximumBytes = $MaxMemory * 1MB
364
+ }
343
365
 
344
366
  $Config = @{
345
367
  ProcessorCount = $processors;
data/version.txt CHANGED
@@ -1 +1 @@
1
- 2.4.6
1
+ 2.4.7
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.6
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitchell Hashimoto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-05-21 00:00:00.000000000 Z
12
+ date: 2025-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: base64