vagrant-tart 0.0.2 → 0.0.3
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 +4 -4
- data/lib/vagrant-tart/action/start_instance.rb +1 -1
- data/lib/vagrant-tart/action.rb +3 -1
- data/lib/vagrant-tart/config.rb +6 -6
- data/lib/vagrant-tart/model/get_result.rb +2 -2
- data/lib/vagrant-tart/plugin.rb +0 -1
- data/lib/vagrant-tart/util/driver.rb +1 -1
- data/lib/vagrant-tart/version.rb +1 -1
- data/locales/en.yml +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7304968aeaf2c309ef4e77a350054f83fb24d6119518e2372639ac27f51b3c73
|
4
|
+
data.tar.gz: 7baed83d857caeb259d10798500493e69bbf6267234dca7789e8654576a6ad8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a9a0510aa5cf86519e744de29182bfd3feccd0545314b170ec955c505414bd16d77046dbbbb085d75d004be4db60cb3377effa3ffb66ddc309f6dffb6b78f97
|
7
|
+
data.tar.gz: cf738b29374eda9c4884c6c03dd58ae6fd96383ba44b9f31d19695397f71497a9fab1a4e94a7d01098f3611a3c2940cdd737326827bad115349f76c917ba74db
|
@@ -25,7 +25,7 @@ module VagrantPlugins
|
|
25
25
|
return @app.call(env) if instance.nil? || instance.vagrant_state == :running
|
26
26
|
|
27
27
|
env[:ui].output(I18n.t("vagrant_tart.messages.configuring_instance", name: name))
|
28
|
-
driver.set(name, "
|
28
|
+
driver.set(name, "cpus", config.cpus)
|
29
29
|
driver.set(name, "memory", config.memory)
|
30
30
|
driver.set(name, "disk", config.disk)
|
31
31
|
driver.set(name, "display", config.display)
|
data/lib/vagrant-tart/action.rb
CHANGED
@@ -14,11 +14,13 @@ module VagrantPlugins
|
|
14
14
|
action_root = Pathname.new(File.expand_path("action", __dir__))
|
15
15
|
autoload :CreateInstance, action_root.join("create_instance")
|
16
16
|
autoload :DeleteInstance, action_root.join("delete_instance")
|
17
|
+
autoload :ForwardPorts, action_root.join("forward_ports")
|
17
18
|
autoload :GetState, action_root.join("get_state")
|
18
19
|
autoload :Login, action_root.join("login")
|
19
20
|
autoload :PullImage, action_root.join("pull_image")
|
20
21
|
autoload :StartInstance, action_root.join("start_instance")
|
21
22
|
autoload :StopInstance, action_root.join("stop_instance")
|
23
|
+
autoload :SuspendInstance, action_root.join("suspend_instance")
|
22
24
|
|
23
25
|
# Vargrant action "destroy".
|
24
26
|
def self.action_destroy
|
@@ -26,7 +28,7 @@ module VagrantPlugins
|
|
26
28
|
b.use ConfigValidate
|
27
29
|
|
28
30
|
b.use Call, IsState, :not_created do |env1, b1|
|
29
|
-
raise Errors::InstanceNotCreatedError if
|
31
|
+
raise Errors::InstanceNotCreatedError if env1[:result]
|
30
32
|
|
31
33
|
b1.use Call, DestroyConfirm do |env2, b2|
|
32
34
|
if env2[:result]
|
data/lib/vagrant-tart/config.rb
CHANGED
@@ -22,7 +22,7 @@ module VagrantPlugins
|
|
22
22
|
attr_accessor :name
|
23
23
|
|
24
24
|
# @return [Integer] Number of CPUs
|
25
|
-
attr_accessor :
|
25
|
+
attr_accessor :cpus
|
26
26
|
# @return [Integer] Memory size in MB
|
27
27
|
attr_accessor :memory
|
28
28
|
# @return [Integer] Disk storage size in GB
|
@@ -48,7 +48,7 @@ module VagrantPlugins
|
|
48
48
|
@image = UNSET_VALUE
|
49
49
|
@name = UNSET_VALUE
|
50
50
|
|
51
|
-
@
|
51
|
+
@cpus = UNSET_VALUE
|
52
52
|
@memory = UNSET_VALUE
|
53
53
|
@disk = UNSET_VALUE
|
54
54
|
@gui = UNSET_VALUE
|
@@ -67,7 +67,7 @@ module VagrantPlugins
|
|
67
67
|
@image = nil if @image == UNSET_VALUE
|
68
68
|
@name = nil if @name == UNSET_VALUE
|
69
69
|
|
70
|
-
@
|
70
|
+
@cpus = 1 if @cpus == UNSET_VALUE
|
71
71
|
@memory = 1024 if @memory == UNSET_VALUE
|
72
72
|
@disk = 10 if @disk == UNSET_VALUE
|
73
73
|
@gui = false if @gui == UNSET_VALUE
|
@@ -92,10 +92,10 @@ module VagrantPlugins
|
|
92
92
|
# Check that the GUI flag is a valid boolean
|
93
93
|
errors << I18n.t("vagrant_tart.config.gui_invalid") unless @gui == true || @gui == false
|
94
94
|
|
95
|
-
# Check that
|
95
|
+
# Check that CPUs is a valid number and between 1 and the maximum available CPUs
|
96
96
|
max_cpus = Etc.nprocessors
|
97
|
-
unless (@
|
98
|
-
errors << I18n.t("vagrant_tart.config.
|
97
|
+
unless (@cpus.is_a? Integer) && @cpus >= 1 && @cpus <= max_cpus
|
98
|
+
errors << I18n.t("vagrant_tart.config.cpus_invalid", max_cpus: max_cpus)
|
99
99
|
end
|
100
100
|
|
101
101
|
# Check that memory is a valid number and between 1 and the maximum available memory
|
@@ -6,7 +6,7 @@ module VagrantPlugins
|
|
6
6
|
# Represents the result of a Tart 'get' operation.
|
7
7
|
class GetResult
|
8
8
|
# @return [Integer] The number of CPUs of the machine.
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :cpus
|
10
10
|
# @return [Integer] The size of the machine's disk.
|
11
11
|
attr_accessor :disk
|
12
12
|
# @return [Boolean] Whether the machine is running.
|
@@ -25,7 +25,7 @@ module VagrantPlugins
|
|
25
25
|
# Initialize the result from raw data.
|
26
26
|
# @param [Hash] data The raw data.
|
27
27
|
def initialize(data)
|
28
|
-
@
|
28
|
+
@cpus = data["CPU"]
|
29
29
|
@disk = data["Disk"]
|
30
30
|
@running = data["Running"]
|
31
31
|
@memory = data["Memory"]
|
data/lib/vagrant-tart/plugin.rb
CHANGED
data/lib/vagrant-tart/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -8,8 +8,8 @@ en:
|
|
8
8
|
|
9
9
|
gui_invalid: |-
|
10
10
|
Configuration must specify a valid GUI setting (true or false)
|
11
|
-
|
12
|
-
Configuration must specify a valid
|
11
|
+
cpus_invalid: |-
|
12
|
+
Configuration must specify a valid CPUs count (between 1 and %{max_cpus})
|
13
13
|
memory_invalid: |-
|
14
14
|
Configuration must specify a valid memory size (between 1 and %{max_memory} MB)
|
15
15
|
disk_invalid: |-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-tart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Etiemble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Allows Vagrant to manage Tart virtual machines.
|
14
14
|
email:
|