vagrant-solaris10 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-solaris10/cap/mount_nfs_folder.rb +47 -0
- data/lib/vagrant-solaris10/cap/mount_parallels_shared_folder.rb +1 -1
- data/lib/vagrant-solaris10/cap/shell_expand_guest_path.rb +33 -0
- data/lib/vagrant-solaris10/plugin.rb +10 -1
- data/lib/vagrant-solaris10/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fe793851c454fdf9487f7926caeb4315a77694b
|
4
|
+
data.tar.gz: a23a987241ac69f815e8aa308b732e5467e63e36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 194c73b855a7bef609f32aedf674e2e4000f9de77ea9bd2f929cc80346778aed199492cac7ac77f2151fdafdc0bb9357c6fda2f4dc561c7bdfd3bd2734f57301
|
7
|
+
data.tar.gz: 4751b5fba00849c604785c02b2796ca1c3d87821e9d94072dcd87a5b3d2dda88a774fcea2bc74af4c5f35f6f3c874635cf7b3e24c4554ccc2eeb8d0673d7e284
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Copyright (c) 2014 Tnarik Innael - adaptation to Solaris and repackaging
|
2
|
+
# Copyright (c) 2013-2014 Mitchell Hashimoto - from plugins/guests/darwin/cap/mount_vnfs_folder.rb
|
3
|
+
require "vagrant/util/retryable"
|
4
|
+
require "vagrant/errors"
|
5
|
+
|
6
|
+
module Vagrant
|
7
|
+
module Errors
|
8
|
+
class Vagrant::Errors::SolarisNFSMountFailed < VagrantError
|
9
|
+
error_key(:solaris_nfs_mount_failed)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module Solaris10
|
14
|
+
module Cap
|
15
|
+
class MountNFSFolder
|
16
|
+
extend Vagrant::Util::Retryable
|
17
|
+
|
18
|
+
def self.mount_nfs_folder(machine, ip, folders)
|
19
|
+
folders.each do |name, opts|
|
20
|
+
# Expand the guest path so we can handle things like "~/vagrant"
|
21
|
+
expanded_guest_path = machine.guest.capability(
|
22
|
+
:shell_expand_guest_path, opts[:guestpath])
|
23
|
+
|
24
|
+
# Create the folder
|
25
|
+
machine.communicate.sudo("mkdir -p #{expanded_guest_path}")
|
26
|
+
|
27
|
+
# Figure out any options
|
28
|
+
mount_opts = ["vers=#{opts[:nfs_version]}"]
|
29
|
+
if opts[:mount_options]
|
30
|
+
mount_opts = opts[:mount_options].dup
|
31
|
+
end
|
32
|
+
|
33
|
+
mount_command = "mount -F nfs " +
|
34
|
+
"-o '#{mount_opts.join(",")}' " +
|
35
|
+
"'#{ip}:#{opts[:hostpath]}' '#{expanded_guest_path}'"
|
36
|
+
retryable(on: Vagrant::Errors::SolarisNFSMountFailed, tries: 10, sleep: 5) do
|
37
|
+
machine.communicate.sudo(
|
38
|
+
mount_command,
|
39
|
+
error_class: Vagrant::Errors::SolarisNFSMountFailed)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright (c) 2014 Tnarik Innael - repackaged
|
2
|
+
# Copyright (c) 2014 Mitchell Hashimoto - from plugins/guest/linux/cap/shell_expand_guest_path.rb
|
3
|
+
module Vagrant
|
4
|
+
module Solaris10
|
5
|
+
module Cap
|
6
|
+
class ShellExpandGuestPath
|
7
|
+
|
8
|
+
def self.shell_expand_guest_path(machine, path)
|
9
|
+
real_path = nil
|
10
|
+
machine.communicate.execute("echo; printf #{path}") do |type, data|
|
11
|
+
if type == :stdout
|
12
|
+
real_path ||= ""
|
13
|
+
real_path += data
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# The last line is the path we care about
|
18
|
+
real_path = real_path.split("\n").last.chomp
|
19
|
+
|
20
|
+
if !real_path
|
21
|
+
# If no real guest path was detected, this is really strange
|
22
|
+
# and we raise an exception because this is a bug.
|
23
|
+
raise ShellExpandFailed
|
24
|
+
end
|
25
|
+
|
26
|
+
# Chomp the string so that any trailing newlines are killed
|
27
|
+
return real_path.chomp
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -2,7 +2,6 @@ require "vagrant"
|
|
2
2
|
|
3
3
|
module Vagrant
|
4
4
|
module Solaris10
|
5
|
-
|
6
5
|
class Plugin < Vagrant.plugin("2")
|
7
6
|
name "Solaris10 guest"
|
8
7
|
description "Solaris10 guest support."
|
@@ -17,6 +16,11 @@ module Vagrant
|
|
17
16
|
Cap::MountParallelsSharedFolder
|
18
17
|
end
|
19
18
|
|
19
|
+
guest_capability("solaris", "mount_nfs_folder") do
|
20
|
+
require_relative "cap/mount_nfs_folder"
|
21
|
+
Cap::MountNFSFolder
|
22
|
+
end
|
23
|
+
|
20
24
|
guest_capability("solaris", "insert_public_key") do
|
21
25
|
require_relative "cap/insert_public_key"
|
22
26
|
Cap::InsertPublicKey
|
@@ -27,6 +31,11 @@ module Vagrant
|
|
27
31
|
Cap::RemovePublicKey
|
28
32
|
end
|
29
33
|
|
34
|
+
guest_capability("solaris", "shell_expand_guest_path") do
|
35
|
+
require_relative "cap/shell_expand_guest_path"
|
36
|
+
Cap::ShellExpandGuestPath
|
37
|
+
end
|
38
|
+
|
30
39
|
guest_capability("solaris", "rsync_post") do
|
31
40
|
require_relative "cap/rsync"
|
32
41
|
Cap::RSync
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-solaris10
|
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
|
- Tnarik Innael
|
@@ -55,10 +55,12 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- lib/vagrant-solaris10.rb
|
57
57
|
- lib/vagrant-solaris10/cap/insert_public_key.rb
|
58
|
+
- lib/vagrant-solaris10/cap/mount_nfs_folder.rb
|
58
59
|
- lib/vagrant-solaris10/cap/mount_parallels_shared_folder.rb
|
59
60
|
- lib/vagrant-solaris10/cap/mount_vmware_shared_folder.rb
|
60
61
|
- lib/vagrant-solaris10/cap/remove_public_key.rb
|
61
62
|
- lib/vagrant-solaris10/cap/rsync.rb
|
63
|
+
- lib/vagrant-solaris10/cap/shell_expand_guest_path.rb
|
62
64
|
- lib/vagrant-solaris10/plugin.rb
|
63
65
|
- lib/vagrant-solaris10/version.rb
|
64
66
|
- vagrant-solaris10.gemspec
|