vagrant-patches 1.6.5.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: de7becda9c65705d1c1649affa85e963bddeb9dd
4
+ data.tar.gz: 5bc5d90a370bcdcc7b4c12592af645000f8008eb
5
+ SHA512:
6
+ metadata.gz: 3c5b97dd033cc7e94b2a269ab3616ca5b9084664106241a04bd9e374bfc64e1ef1712c573515b21b7a09e375b46a5e9ce905dac660b16d3e73d66116725a6364
7
+ data.tar.gz: a0ab02951b6a8a1dcc5d9e904701df35d7013d222d5dbcb5a86a335b73ccb89e0b879a329fc80f0e9d769f63ba18a30398ed3593e7b8251ecc4d1a6f7f4e7ce2
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-patches.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Felix Gilcher
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Vagrant::Patches
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'vagrant-patches'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install vagrant-patches
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/vagrant-patches/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,12 @@
1
+ begin
2
+ require 'vagrant'
3
+ rescue LoadError
4
+ raise 'The Vagrant Patches plugin must be run within vagrant.'
5
+ end
6
+ if Vagrant::VERSION < '1.6.5'
7
+ raise 'The Vagrant Patches plugin has only been tested with vagrant 1.6.5'
8
+ end
9
+
10
+ require "vagrant-patches/version"
11
+ require "vagrant-patches/issue-4465"
12
+ require "vagrant-patches/issue-4494"
@@ -0,0 +1,40 @@
1
+ require Vagrant.source_root.join("plugins/guests/redhat/cap/change_host_name")
2
+
3
+ # monkeypatch the change_hostname capability of the redhat plugin to
4
+ # fix https://github.com/mitchellh/vagrant/issues/4465
5
+ module VagrantPlugins
6
+ module GuestRedHat
7
+ module Cap
8
+ class ChangeHostName
9
+ def self.change_host_name(machine, name)
10
+ new(machine, name).change!
11
+ end
12
+
13
+ def change!
14
+ return unless should_change?
15
+
16
+ case machine.guest.capability("flavor")
17
+ when :rhel_7
18
+ update_hostname_rhel7
19
+ update_etc_hosts
20
+ else
21
+ update_sysconfig
22
+ update_hostname
23
+ update_etc_hosts
24
+ update_dhcp_hostnames
25
+ restart_networking
26
+ end
27
+ end
28
+
29
+ def should_change?
30
+ new_hostname != current_hostname
31
+ end
32
+
33
+ def update_hostname_rhel7
34
+ sudo "hostnamectl set-hostname #{fqdn}"
35
+ end
36
+
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,59 @@
1
+ require "vagrant/action/builtin/box_add"
2
+
3
+ # monkeypatch the vagrant box_add action to fix issue https://github.com/mitchellh/vagrant/issues/4494
4
+ module Vagrant
5
+ module Action
6
+ module Builtin
7
+ # This middleware will download a remote box and add it to the
8
+ # given box collection.
9
+ class BoxAdd
10
+
11
+ protected
12
+
13
+ # Returns the download options for the download.
14
+ #
15
+ # @return [Hash]
16
+ def downloader(url, env, **opts)
17
+ opts[:ui] = true if !opts.has_key?(:ui)
18
+
19
+ temp_path = env[:tmp_path].join("box" + Digest::SHA1.hexdigest(url))
20
+ @logger.info("Downloading box: #{url} => #{temp_path}")
21
+
22
+ if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i
23
+ @logger.info("URL is a file or protocol not found and assuming file.")
24
+ file_path = File.expand_path(url)
25
+ file_path = Util::Platform.cygwin_windows_path(file_path)
26
+ url = "file:#{file_path}"
27
+ end
28
+
29
+ # If the temporary path exists, verify it is not too old. If its
30
+ # too old, delete it first because the data may have changed.
31
+ if temp_path.file?
32
+ delete = false
33
+ if env[:box_clean]
34
+ @logger.info("Cleaning existing temp box file.")
35
+ delete = true
36
+ elsif temp_path.mtime.to_i < (Time.now.to_i - 6 * 60 * 60)
37
+ @logger.info("Existing temp file is too old. Removing.")
38
+ delete = true
39
+ end
40
+
41
+ temp_path.unlink if delete
42
+ end
43
+
44
+ downloader_options = {}
45
+ downloader_options[:ca_cert] = env[:box_download_ca_cert]
46
+ downloader_options[:ca_path] = env[:box_download_ca_path]
47
+ downloader_options[:continue] = true
48
+ downloader_options[:insecure] = env[:box_download_insecure]
49
+ downloader_options[:client_cert] = env[:box_download_client_cert]
50
+ downloader_options[:headers] = ["Accept: application/json"] if opts[:json]
51
+ downloader_options[:ui] = env[:ui] if opts[:ui]
52
+
53
+ Util::Downloader.new(url, temp_path, downloader_options)
54
+ end
55
+
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,3 @@
1
+ module VagrantPatches
2
+ VERSION = "1.6.5.1"
3
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-patches/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-patches"
8
+ spec.version = VagrantPatches::VERSION
9
+ spec.authors = ["Felix Gilcher"]
10
+ spec.email = ["felix.gilcher@asquera.de"]
11
+ spec.summary = %q{A collection of various patches that have not yet been accepted to vagrant}
12
+ spec.description = %q{A collection of patches for vagrant that have not yet been accepted. Includes fixes for box downloading and CentOS 7}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-patches
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.5.1
5
+ platform: ruby
6
+ authors:
7
+ - Felix Gilcher
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: A collection of patches for vagrant that have not yet been accepted.
42
+ Includes fixes for box downloading and CentOS 7
43
+ email:
44
+ - felix.gilcher@asquera.de
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - lib/vagrant-patches.rb
55
+ - lib/vagrant-patches/issue-4465.rb
56
+ - lib/vagrant-patches/issue-4494.rb
57
+ - lib/vagrant-patches/version.rb
58
+ - vagrant-patches.gemspec
59
+ homepage: ''
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.2.1
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: A collection of various patches that have not yet been accepted to vagrant
83
+ test_files: []