vagrant-skytap 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.project +11 -0
- data/CHANGELOG.md +4 -0
- data/LICENSE +2 -1
- data/README.md +7 -0
- data/lib/vagrant-skytap/action/action_helpers.rb +35 -0
- data/lib/vagrant-skytap/action/add_vm_to_environment.rb +22 -0
- data/lib/vagrant-skytap/action/clear_forwarded_ports.rb +22 -0
- data/lib/vagrant-skytap/action/compose_environment.rb +22 -0
- data/lib/vagrant-skytap/action/create_environment.rb +22 -0
- data/lib/vagrant-skytap/action/delete_environment.rb +22 -0
- data/lib/vagrant-skytap/action/delete_vm.rb +26 -1
- data/lib/vagrant-skytap/action/existence_check.rb +26 -1
- data/lib/vagrant-skytap/action/fetch_environment.rb +22 -0
- data/lib/vagrant-skytap/action/forward_ports.rb +22 -0
- data/lib/vagrant-skytap/action/initial_state.rb +22 -0
- data/lib/vagrant-skytap/action/initialize_api_client.rb +22 -0
- data/lib/vagrant-skytap/action/is_parallelized.rb +22 -0
- data/lib/vagrant-skytap/action/is_running.rb +22 -0
- data/lib/vagrant-skytap/action/is_stopped.rb +22 -0
- data/lib/vagrant-skytap/action/is_suspended.rb +22 -0
- data/lib/vagrant-skytap/action/message_already_created.rb +22 -0
- data/lib/vagrant-skytap/action/message_already_running.rb +22 -0
- data/lib/vagrant-skytap/action/message_environment_url.rb +22 -0
- data/lib/vagrant-skytap/action/message_not_created.rb +22 -0
- data/lib/vagrant-skytap/action/message_resuming.rb +22 -0
- data/lib/vagrant-skytap/action/message_will_not_destroy.rb +22 -0
- data/lib/vagrant-skytap/action/mixin_machine_index.rb +22 -0
- data/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb +22 -0
- data/lib/vagrant-skytap/action/prepare_nfs_settings.rb +22 -0
- data/lib/vagrant-skytap/action/prepare_nfs_valid_ids.rb +22 -0
- data/lib/vagrant-skytap/action/read_ssh_info.rb +22 -0
- data/lib/vagrant-skytap/action/read_state.rb +27 -2
- data/lib/vagrant-skytap/action/run_environment.rb +26 -1
- data/lib/vagrant-skytap/action/run_vm.rb +25 -1
- data/lib/vagrant-skytap/action/set_hostname.rb +26 -1
- data/lib/vagrant-skytap/action/set_up_vm.rb +22 -0
- data/lib/vagrant-skytap/action/stop_environment.rb +22 -0
- data/lib/vagrant-skytap/action/stop_vm.rb +26 -1
- data/lib/vagrant-skytap/action/store_extra_data.rb +22 -0
- data/lib/vagrant-skytap/action/suspend_environment.rb +22 -0
- data/lib/vagrant-skytap/action/suspend_vm.rb +26 -1
- data/lib/vagrant-skytap/action/timed_provision.rb +22 -0
- data/lib/vagrant-skytap/action/update_hardware.rb +29 -4
- data/lib/vagrant-skytap/action/wait_for_communicator.rb +22 -0
- data/lib/vagrant-skytap/action.rb +22 -0
- data/lib/vagrant-skytap/api/busyable.rb +22 -0
- data/lib/vagrant-skytap/api/client.rb +22 -0
- data/lib/vagrant-skytap/api/credentials.rb +22 -0
- data/lib/vagrant-skytap/api/environment.rb +22 -5
- data/lib/vagrant-skytap/api/interface.rb +22 -0
- data/lib/vagrant-skytap/api/network.rb +22 -0
- data/lib/vagrant-skytap/api/public_ip.rb +22 -0
- data/lib/vagrant-skytap/api/publish_set.rb +22 -0
- data/lib/vagrant-skytap/api/published_service.rb +22 -0
- data/lib/vagrant-skytap/api/resource.rb +22 -0
- data/lib/vagrant-skytap/api/runstate_operations.rb +22 -0
- data/lib/vagrant-skytap/api/specified_attributes.rb +22 -0
- data/lib/vagrant-skytap/api/vm.rb +22 -18
- data/lib/vagrant-skytap/api/vpn.rb +22 -0
- data/lib/vagrant-skytap/api/vpn_attachment.rb +22 -0
- data/lib/vagrant-skytap/cap/public_address.rb +22 -0
- data/lib/vagrant-skytap/command/helpers.rb +22 -0
- data/lib/vagrant-skytap/command/publish_url/create.rb +22 -0
- data/lib/vagrant-skytap/command/publish_url/delete.rb +22 -0
- data/lib/vagrant-skytap/command/publish_url/root.rb +22 -0
- data/lib/vagrant-skytap/command/publish_url/show.rb +22 -0
- data/lib/vagrant-skytap/command/up.rb +22 -0
- data/lib/vagrant-skytap/config.rb +22 -0
- data/lib/vagrant-skytap/core_ext/object/blank.rb +22 -0
- data/lib/vagrant-skytap/core_ext/object/tap.rb +22 -0
- data/lib/vagrant-skytap/core_ext/try.rb +22 -0
- data/lib/vagrant-skytap/environment_properties.rb +22 -0
- data/lib/vagrant-skytap/errors.rb +22 -0
- data/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb +22 -0
- data/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb +22 -0
- data/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb +22 -0
- data/lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb +22 -0
- data/lib/vagrant-skytap/model/forwarded_port.rb +22 -0
- data/lib/vagrant-skytap/plugin.rb +22 -0
- data/lib/vagrant-skytap/properties.rb +22 -0
- data/lib/vagrant-skytap/provider.rb +22 -0
- data/lib/vagrant-skytap/setup_helper.rb +25 -1
- data/lib/vagrant-skytap/util/compile_forwarded_ports.rb +22 -0
- data/lib/vagrant-skytap/util/ip_address.rb +22 -0
- data/lib/vagrant-skytap/util/subnet.rb +22 -0
- data/lib/vagrant-skytap/util/timer.rb +22 -0
- data/lib/vagrant-skytap/version.rb +23 -1
- data/lib/vagrant-skytap/vm_properties.rb +22 -0
- data/lib/vagrant-skytap.rb +22 -0
- data/spec/acceptance/base.rb +22 -0
- data/spec/acceptance/provider/halt_spec.rb +22 -0
- data/spec/acceptance/provider/up_spec.rb +22 -0
- data/spec/acceptance/shared/context_skytap.rb +22 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/isolated_environment.rb +22 -0
- data/spec/unit/actions/compose_environment_spec.rb +22 -0
- data/spec/unit/actions/update_hardware_spec.rb +75 -0
- data/spec/unit/base.rb +22 -0
- data/spec/unit/config_spec.rb +22 -0
- data/spec/unit/environment_spec.rb +22 -0
- data/spec/unit/forwarded_port_spec.rb +22 -0
- data/spec/unit/hosts/common/cap/ssh_tunnel_spec.rb +22 -0
- data/spec/unit/prepare_collision_params_spec.rb +22 -0
- data/spec/unit/publish_set_spec.rb +22 -0
- data/spec/unit/setup_helper_spec.rb +22 -0
- data/spec/unit/support/dummy_communicator.rb +22 -0
- data/spec/unit/support/dummy_provider.rb +22 -0
- data/spec/unit/support/isolated_environment.rb +22 -0
- data/spec/unit/support/shared/action_synced_folders_context.rb +22 -0
- data/spec/unit/support/shared/base_context.rb +22 -0
- data/spec/unit/support/shared/capability_helpers_context.rb +22 -0
- data/spec/unit/support/shared/plugin_command_context.rb +22 -0
- data/spec/unit/support/shared/rest_api_context.rb +22 -0
- data/spec/unit/support/shared/skytap_context.rb +22 -0
- data/spec/unit/vm_spec.rb +22 -0
- data/vagrant-skytap.gemspec +25 -3
- data/vagrant-spec.config.rb +22 -0
- metadata +7 -7
@@ -1,4 +1,27 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "log4r"
|
24
|
+
require_relative 'action_helpers'
|
2
25
|
|
3
26
|
module VagrantPlugins
|
4
27
|
module Skytap
|
@@ -6,6 +29,7 @@ module VagrantPlugins
|
|
6
29
|
# Runs the Skytap VM.
|
7
30
|
class RunVm
|
8
31
|
include Vagrant::Util::Retryable
|
32
|
+
include ActionHelpers
|
9
33
|
|
10
34
|
attr_reader :env
|
11
35
|
|
@@ -17,7 +41,7 @@ module VagrantPlugins
|
|
17
41
|
|
18
42
|
def call(env)
|
19
43
|
env[:ui].info(I18n.t("vagrant_skytap.launching_vm"))
|
20
|
-
|
44
|
+
current_vm(env).run!
|
21
45
|
|
22
46
|
@app.call(env)
|
23
47
|
end
|
@@ -1,11 +1,36 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "log4r"
|
2
24
|
#require 'vagrant'
|
25
|
+
require_relative 'action_helpers'
|
3
26
|
|
4
27
|
module VagrantPlugins
|
5
28
|
module Skytap
|
6
29
|
module Action
|
7
30
|
# sets VM hostname via the API
|
8
31
|
class SetHostname
|
32
|
+
include ActionHelpers
|
33
|
+
|
9
34
|
def initialize(app, env)
|
10
35
|
@app = app
|
11
36
|
@logger = Log4r::Logger.new("vagrant_skytap::action::set_hostname")
|
@@ -13,7 +38,7 @@ module VagrantPlugins
|
|
13
38
|
|
14
39
|
def call(env)
|
15
40
|
if hostname = env[:machine].config.vm.hostname
|
16
|
-
if vm = env
|
41
|
+
if vm = current_vm(env)
|
17
42
|
if nic = vm.interfaces.first
|
18
43
|
if hostname != nic.get_api_attribute('hostname')
|
19
44
|
@logger.info("Updating hostname: #{hostname}")
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'log4r'
|
2
24
|
require 'json'
|
3
25
|
require 'vagrant-skytap/setup_helper'
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "log4r"
|
2
24
|
require 'json'
|
3
25
|
|
@@ -1,8 +1,31 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "log4r"
|
2
24
|
require 'json'
|
3
25
|
|
4
26
|
require 'vagrant-skytap/util/timer'
|
5
27
|
require 'vagrant-skytap/api/environment'
|
28
|
+
require_relative 'action_helpers'
|
6
29
|
|
7
30
|
require 'net/https'
|
8
31
|
require 'uri'
|
@@ -15,6 +38,8 @@ module VagrantPlugins
|
|
15
38
|
module Action
|
16
39
|
# Stops the Skytap VM and waits until stopped.
|
17
40
|
class StopVm
|
41
|
+
include ActionHelpers
|
42
|
+
|
18
43
|
attr_reader :env
|
19
44
|
|
20
45
|
def initialize(app, env)
|
@@ -24,7 +49,7 @@ module VagrantPlugins
|
|
24
49
|
end
|
25
50
|
|
26
51
|
def call(env)
|
27
|
-
vm = env
|
52
|
+
vm = current_vm(env)
|
28
53
|
if env[:force_halt]
|
29
54
|
vm.poweroff!
|
30
55
|
else
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'log4r'
|
2
24
|
require_relative "mixin_machine_index"
|
3
25
|
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'json'
|
2
24
|
|
3
25
|
require 'vagrant-skytap/util/timer'
|
@@ -1,7 +1,30 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'json'
|
2
24
|
|
3
25
|
require 'vagrant-skytap/util/timer'
|
4
26
|
require 'vagrant-skytap/api/environment'
|
27
|
+
require_relative 'action_helpers'
|
5
28
|
|
6
29
|
require 'net/https'
|
7
30
|
require 'uri'
|
@@ -14,6 +37,8 @@ module VagrantPlugins
|
|
14
37
|
module Action
|
15
38
|
# Suspends the Skytap VM and waits until suspended.
|
16
39
|
class SuspendVm
|
40
|
+
include ActionHelpers
|
41
|
+
|
17
42
|
attr_reader :env
|
18
43
|
|
19
44
|
def initialize(app, env)
|
@@ -23,7 +48,7 @@ module VagrantPlugins
|
|
23
48
|
end
|
24
49
|
|
25
50
|
def call(env)
|
26
|
-
env
|
51
|
+
current_vm(env).suspend!
|
27
52
|
@app.call(env)
|
28
53
|
end
|
29
54
|
end
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "vagrant-skytap/util/timer"
|
2
24
|
|
3
25
|
module VagrantPlugins
|
@@ -1,21 +1,46 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "log4r"
|
2
24
|
#require 'vagrant'
|
3
25
|
require 'vagrant-skytap/api/vm'
|
26
|
+
require_relative 'action_helpers'
|
4
27
|
|
5
28
|
module VagrantPlugins
|
6
29
|
module Skytap
|
7
30
|
module Action
|
8
|
-
# This action
|
9
|
-
#
|
31
|
+
# This action compares the machine's hardware settings with the
|
32
|
+
# vm's hardware attributes and updates if needed.
|
10
33
|
class UpdateHardware
|
34
|
+
include ActionHelpers
|
35
|
+
|
11
36
|
def initialize(app, env)
|
12
37
|
@app = app
|
13
38
|
@logger = Log4r::Logger.new("vagrant_skytap::action::update_hardware")
|
14
39
|
end
|
15
40
|
|
16
41
|
def call(env)
|
17
|
-
if vm = env
|
18
|
-
provider_config =
|
42
|
+
if vm = current_vm(env)
|
43
|
+
provider_config = env[:machine].provider_config
|
19
44
|
hardware_info = {
|
20
45
|
cpus: provider_config.cpus,
|
21
46
|
cpus_per_socket: provider_config.cpuspersocket,
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'timeout'
|
2
24
|
require "log4r"
|
3
25
|
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require "pathname"
|
2
24
|
require "vagrant/action/builder"
|
3
25
|
|
@@ -1,3 +1,25 @@
|
|
1
|
+
# Copyright (c) 2014-2016 Skytap, Inc.
|
2
|
+
#
|
3
|
+
# The MIT License (MIT)
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
+
# DEALINGS IN THE SOFTWARE.
|
22
|
+
|
1
23
|
require 'timeout'
|
2
24
|
|
3
25
|
module VagrantPlugins
|