vagrant-bolt 0.1.1 → 0.4.0

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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/spec.yml +71 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +3 -8
  5. data/CHANGELOG.md +65 -4
  6. data/Gemfile +5 -4
  7. data/README.md +33 -18
  8. data/acceptance/components/bolt_spec.rb +27 -28
  9. data/acceptance/skeletons/advanced/Vagrantfile +2 -2
  10. data/acceptance/skeletons/base/Puppetfile +2 -0
  11. data/acceptance/skeletons/base/Vagrantfile +2 -1
  12. data/acceptance/skeletons/provisioner/Vagrantfile +1 -1
  13. data/acceptance/skeletons/trigger/Vagrantfile +1 -1
  14. data/acceptance/vagrant-spec.config.rb +3 -3
  15. data/lib/vagrant-bolt/command.rb +6 -6
  16. data/lib/vagrant-bolt/config/bolt.rb +31 -22
  17. data/lib/vagrant-bolt/config/global.rb +30 -3
  18. data/lib/vagrant-bolt/config_builder/config.rb +35 -5
  19. data/lib/vagrant-bolt/config_builder/monkey_patches.rb +2 -1
  20. data/lib/vagrant-bolt/config_builder/provisioner.rb +28 -4
  21. data/lib/vagrant-bolt/runner.rb +10 -10
  22. data/lib/vagrant-bolt/util/bolt.rb +7 -6
  23. data/lib/vagrant-bolt/util/config.rb +3 -2
  24. data/lib/vagrant-bolt/util/machine.rb +4 -3
  25. data/lib/vagrant-bolt/version.rb +1 -1
  26. data/spec/unit/config/bolt_spec.rb +8 -1
  27. data/spec/unit/config/global_spec.rb +9 -3
  28. data/spec/unit/runner/runner_spec.rb +37 -11
  29. data/spec/unit/util/bolt_spec.rb +25 -6
  30. data/tasks/changelog.rake +1 -1
  31. metadata +9 -26
  32. data/.travis.yml +0 -28
  33. data/acceptance/skeletons/base/modules/facts/CHANGELOG.md +0 -26
  34. data/acceptance/skeletons/base/modules/facts/CONTRIBUTING.md +0 -279
  35. data/acceptance/skeletons/base/modules/facts/Gemfile +0 -98
  36. data/acceptance/skeletons/base/modules/facts/LICENSE +0 -201
  37. data/acceptance/skeletons/base/modules/facts/README.md +0 -45
  38. data/acceptance/skeletons/base/modules/facts/Rakefile +0 -8
  39. data/acceptance/skeletons/base/modules/facts/checksums.json +0 -42
  40. data/acceptance/skeletons/base/modules/facts/lib/puppet/functions/facts/group_by.rb +0 -14
  41. data/acceptance/skeletons/base/modules/facts/metadata.json +0 -62
  42. data/acceptance/skeletons/base/modules/facts/plans/info.pp +0 -16
  43. data/acceptance/skeletons/base/modules/facts/plans/init.pp +0 -13
  44. data/acceptance/skeletons/base/modules/facts/tasks/bash.json +0 -5
  45. data/acceptance/skeletons/base/modules/facts/tasks/bash.sh +0 -93
  46. data/acceptance/skeletons/base/modules/facts/tasks/init.json +0 -10
  47. data/acceptance/skeletons/base/modules/facts/tasks/powershell.json +0 -4
  48. data/acceptance/skeletons/base/modules/facts/tasks/powershell.ps1 +0 -56
  49. data/acceptance/skeletons/base/modules/facts/tasks/ruby.json +0 -4
  50. data/acceptance/skeletons/base/modules/facts/tasks/ruby.rb +0 -40
@@ -1,28 +0,0 @@
1
- ---
2
- sudo: false
3
- dist: trusty
4
- language: ruby
5
- cache: bundler
6
- before_install:
7
- - bundle -v
8
- - rm -f Gemfile.lock
9
- - gem update --system
10
- - gem --version
11
- - bundle -v
12
- notifications:
13
- email: false
14
- script:
15
- - 'bundle exec rake rubocop spec'
16
- bundler_args: --without system_tests
17
- env:
18
- global:
19
- - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
20
- rvm:
21
- - 2.5.0
22
- matrix:
23
- fast_finish: true
24
- include:
25
- - rvm: 2.4.4
26
- env: TEST_VAGRANT_VERSION=v2.2.2
27
- - rvm: 2.5.0
28
- env: TEST_VAGRANT_VERSION=HEAD
@@ -1,26 +0,0 @@
1
- # Change Log
2
-
3
- ## 0.3.1
4
- ### Fixed
5
- - Allow setting Puppet gem version via `PUPPET_GEM_VERSION` so we can use Puppet 5 to ship the module.
6
-
7
- ## 0.3.0
8
- ### Fixed
9
- - Task metadata specifies environment input to work around BOLT-691.
10
-
11
- ### Changed
12
- - Stop hiding failures gathering facts in the `facts` plan.
13
-
14
- ### Removed
15
- - `facts::retrieve` as redundant with the `facts` task when cross-platform
16
- tasks are supported.
17
-
18
- ## 0.2.0
19
- ### Added
20
- - Legacy facts added to results.
21
- - Improve ability of bash and ruby task to find facter executable path.
22
-
23
- ## 0.1.2
24
-
25
- ### Changed
26
- - Move facts to external module (from bolt).
@@ -1,279 +0,0 @@
1
- # Contributing to Puppet modules
2
-
3
- So you want to contribute to a Puppet module: Great! Below are some instructions to get you started doing
4
- that very thing while setting expectations around code quality as well as a few tips for making the
5
- process as easy as possible.
6
-
7
- ### Table of Contents
8
-
9
- 1. [Getting Started](#getting-started)
10
- 1. [Commit Checklist](#commit-checklist)
11
- 1. [Submission](#submission)
12
- 1. [More about commits](#more-about-commits)
13
- 1. [Testing](#testing)
14
- - [Running Tests](#running-tests)
15
- - [Writing Tests](#writing-tests)
16
- 1. [Get Help](#get-help)
17
-
18
- ## Getting Started
19
-
20
- - Fork the module repository on GitHub and clone to your workspace
21
-
22
- - Make your changes!
23
-
24
- ## Commit Checklist
25
-
26
- ### The Basics
27
-
28
- - [x] my commit is a single logical unit of work
29
-
30
- - [x] I have checked for unnecessary whitespace with "git diff --check"
31
-
32
- - [x] my commit does not include commented out code or unneeded files
33
-
34
- ### The Content
35
-
36
- - [x] my commit includes tests for the bug I fixed or feature I added
37
-
38
- - [x] my commit includes appropriate documentation changes if it is introducing a new feature or changing existing functionality
39
-
40
- - [x] my code passes existing test suites
41
-
42
- ### The Commit Message
43
-
44
- - [x] the first line of my commit message includes:
45
-
46
- - [x] an issue number (if applicable), e.g. "(MODULES-xxxx) This is the first line"
47
-
48
- - [x] a short description (50 characters is the soft limit, excluding ticket number(s))
49
-
50
- - [x] the body of my commit message:
51
-
52
- - [x] is meaningful
53
-
54
- - [x] uses the imperative, present tense: "change", not "changed" or "changes"
55
-
56
- - [x] includes motivation for the change, and contrasts its implementation with the previous behavior
57
-
58
- ## Submission
59
-
60
- ### Pre-requisites
61
-
62
- - Make sure you have a [GitHub account](https://github.com/join)
63
-
64
- - [Create a ticket](https://tickets.puppet.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppet.com/browse/) you are patching for.
65
-
66
- ### Push and PR
67
-
68
- - Push your changes to your fork
69
-
70
- - [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) against the repository in the puppetlabs organization
71
-
72
- ## More about commits
73
-
74
- 1. Make separate commits for logically separate changes.
75
-
76
- Please break your commits down into logically consistent units
77
- which include new or changed tests relevant to the rest of the
78
- change. The goal of doing this is to make the diff easier to
79
- read for whoever is reviewing your code. In general, the easier
80
- your diff is to read, the more likely someone will be happy to
81
- review it and get it into the code base.
82
-
83
- If you are going to refactor a piece of code, please do so as a
84
- separate commit from your feature or bug fix changes.
85
-
86
- We also really appreciate changes that include tests to make
87
- sure the bug is not re-introduced, and that the feature is not
88
- accidentally broken.
89
-
90
- Describe the technical detail of the change(s). If your
91
- description starts to get too long, that is a good sign that you
92
- probably need to split up your commit into more finely grained
93
- pieces.
94
-
95
- Commits which plainly describe the things which help
96
- reviewers check the patch and future developers understand the
97
- code are much more likely to be merged in with a minimum of
98
- bike-shedding or requested changes. Ideally, the commit message
99
- would include information, and be in a form suitable for
100
- inclusion in the release notes for the version of Puppet that
101
- includes them.
102
-
103
- Please also check that you are not introducing any trailing
104
- whitespace or other "whitespace errors". You can do this by
105
- running "git diff --check" on your changes before you commit.
106
-
107
- 2. Sending your patches
108
-
109
- To submit your changes via a GitHub pull request, we _highly_
110
- recommend that you have them on a topic branch, instead of
111
- directly on "master".
112
- It makes things much easier to keep track of, especially if
113
- you decide to work on another thing before your first change
114
- is merged in.
115
-
116
- GitHub has some pretty good
117
- [general documentation](http://help.github.com/) on using
118
- their site. They also have documentation on
119
- [creating pull requests](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
120
-
121
- In general, after pushing your topic branch up to your
122
- repository on GitHub, you can switch to the branch in the
123
- GitHub UI and click "Pull Request" towards the top of the page
124
- in order to open a pull request.
125
-
126
- 3. Update the related JIRA issue.
127
-
128
- If there is a JIRA issue associated with the change you
129
- submitted, then you should update the ticket to include the
130
- location of your branch, along with any other commentary you
131
- may wish to make.
132
-
133
- # Testing
134
-
135
- ## Getting Started
136
-
137
- Our Puppet modules provide [`Gemfile`](./Gemfile)s, which can tell a Ruby package manager such as [bundler](http://bundler.io/) what Ruby packages,
138
- or Gems, are required to build, develop, and test this software.
139
-
140
- Please make sure you have [bundler installed](http://bundler.io/#getting-started) on your system, and then use it to
141
- install all dependencies needed for this project in the project root by running
142
-
143
- ```shell
144
- % bundle install --path .bundle/gems
145
- Fetching gem metadata from https://rubygems.org/........
146
- Fetching gem metadata from https://rubygems.org/..
147
- Using rake (10.1.0)
148
- Using builder (3.2.2)
149
- -- 8><-- many more --><8 --
150
- Using rspec-system-puppet (2.2.0)
151
- Using serverspec (0.6.3)
152
- Using rspec-system-serverspec (1.0.0)
153
- Using bundler (1.3.5)
154
- Your bundle is complete!
155
- Use `bundle show [gemname]` to see where a bundled gem is installed.
156
- ```
157
-
158
- NOTE: some systems may require you to run this command with sudo.
159
-
160
- If you already have those gems installed, make sure they are up-to-date:
161
-
162
- ```shell
163
- % bundle update
164
- ```
165
-
166
- ## Running Tests
167
-
168
- With all dependencies in place and up-to-date, run the tests:
169
-
170
- ### Unit Tests
171
-
172
- ```shell
173
- % bundle exec rake spec
174
- ```
175
-
176
- This executes all the [rspec tests](http://rspec-puppet.com/) in the directories defined [here](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/699d9fbca1d2489bff1736bb254bb7b7edb32c74/lib/puppetlabs_spec_helper/rake_tasks.rb#L17) and so on.
177
- rspec tests may have the same kind of dependencies as the module they are testing. Although the module defines these dependencies in its [metadata.json](./metadata.json),
178
- rspec tests define them in [.fixtures.yml](./fixtures.yml).
179
-
180
- ### Acceptance Tests
181
-
182
- Some Puppet modules also come with acceptance tests, which use [beaker][]. These tests spin up a virtual machine under
183
- [VirtualBox](https://www.virtualbox.org/), controlled with [Vagrant](http://www.vagrantup.com/), to simulate scripted test
184
- scenarios. In order to run these, you need both Virtualbox and Vagrant installed on your system.
185
-
186
- Run the tests by issuing the following command
187
-
188
- ```shell
189
- % bundle exec rake spec_clean
190
- % bundle exec rspec spec/acceptance
191
- ```
192
-
193
- This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml),
194
- install Puppet, copy this module, and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb)
195
- and then run all the tests under [spec/acceptance](./spec/acceptance).
196
-
197
- A specific node set can be selected by setting the `BEAKER_set` environment variable
198
-
199
- ```shell
200
- % export BEAKER_set=spec/acceptance/nodesets/centos-7-x64
201
- ```
202
-
203
- If using a VM pooler node set, a password must be set via `BEAKER_password`.
204
-
205
- ## Writing Tests
206
-
207
- ### Unit Tests
208
-
209
- When writing unit tests for Puppet, [rspec-puppet][] is your best friend. It provides tons of helper methods for testing your manifests against a
210
- catalog (e.g. contain_file, contain_package, with_params, etc). It would be ridiculous to try and top rspec-puppet's [documentation][rspec-puppet_docs]
211
- but here's a tiny sample:
212
-
213
- Sample manifest:
214
-
215
- ```puppet
216
- file { "a test file":
217
- ensure => present,
218
- path => "/etc/sample",
219
- }
220
- ```
221
-
222
- Sample test:
223
-
224
- ```ruby
225
- it 'does a thing' do
226
- expect(subject).to contain_file("a test file").with({:path => "/etc/sample"})
227
- end
228
- ```
229
-
230
- ### Acceptance Tests
231
-
232
- Writing acceptance tests for Puppet involves [beaker][] and its cousin [beaker-rspec][]. A common pattern for acceptance tests is to create a test manifest, apply it
233
- twice to check for idempotency or errors, then run expectations.
234
-
235
- ```ruby
236
- it 'does an end-to-end thing' do
237
- pp = <<-EOF
238
- file { 'a test file':
239
- ensure => present,
240
- path => "/etc/sample",
241
- content => "test string",
242
- }
243
-
244
- apply_manifest(pp, :catch_failures => true)
245
- apply_manifest(pp, :catch_changes => true)
246
-
247
- end
248
-
249
- describe file("/etc/sample") do
250
- it { is_expected.to contain "test string" }
251
- end
252
-
253
- ```
254
-
255
- # If you have commit access to the repository
256
-
257
- Even if you have commit access to the repository, you still need to go through the process above, and have someone else review and merge
258
- in your changes. The rule is that **all changes must be reviewed by a project developer that did not write the code to ensure that
259
- all changes go through a code review process.**
260
-
261
- The record of someone performing the merge is the record that they performed the code review. Again, this should be someone other than the author of the topic branch.
262
-
263
- # Get Help
264
-
265
- ### On the web
266
- * [Puppet help messageboard](http://puppet.com/community/get-help)
267
- * [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing)
268
- * [General GitHub documentation](http://help.github.com/)
269
- * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
270
-
271
- ### On chat
272
- * Slack (slack.puppet.com) #forge-modules, #puppet-dev, #windows, #voxpupuli
273
- * IRC (freenode) #puppet-dev, #voxpupuli
274
-
275
-
276
- [rspec-puppet]: http://rspec-puppet.com/
277
- [rspec-puppet_docs]: http://rspec-puppet.com/documentation/
278
- [beaker]: https://github.com/puppetlabs/beaker
279
- [beaker-rspec]: https://github.com/puppetlabs/beaker-rspec
@@ -1,98 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source ENV['GEM_SOURCE'] || 'https://rubygems.org'
4
-
5
- def location_for(place_or_version, fake_version = nil)
6
- if place_or_version =~ /\A(git[:@][^#]*)#(.*)/
7
- [fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
8
- elsif place_or_version =~ %r{\Afile:\/\/(.*)}
9
- ['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
10
- else
11
- [place_or_version, { require: false }]
12
- end
13
- end
14
-
15
- ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
16
- minor_version = ruby_version_segments[0..1].join('.')
17
-
18
- group :development do
19
- if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
20
- gem "fast_gettext", '1.1.0', require: false
21
- elsif Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
22
- gem "fast_gettext", require: false
23
- end
24
- if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
25
- gem "json_pure", '<= 2.0.1', require: false
26
- end
27
- if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
28
- gem "json", '= 1.8.1', require: false
29
- end
30
- if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
31
- gem "json", '<= 2.0.4', require: false
32
- end
33
- gem "puppet-module-posix-default-r#{minor_version}",
34
- require: false, platforms: [:ruby]
35
- gem "puppet-module-posix-dev-r#{minor_version}",
36
- require: false, platforms: [:ruby]
37
- gem "puppet-module-win-default-r#{minor_version}",
38
- require: false, platforms: %i[mswin mingw x64_mingw]
39
- gem "puppet-module-win-dev-r#{minor_version}",
40
- require: false, platforms: %i[mswin mingw x64_mingw]
41
- gem "puppet-blacksmith", '~> 3.4',
42
- require: false, platforms: [:ruby]
43
- end
44
-
45
- group :system_tests do
46
- gem "puppet-module-posix-system-r#{minor_version}",
47
- require: false, platforms: [:ruby]
48
- gem "puppet-module-win-system-r#{minor_version}",
49
- require: false, platforms: %i[mswin mingw x64_mingw]
50
- gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
51
- gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
52
- gem "beaker-hostgenerator"
53
- gem "beaker-pe",
54
- require: false
55
- gem "beaker-rspec"
56
- end
57
-
58
- # Temporarily pin to Puppet 6. 6.0.1 introduces a change in behavior that
59
- # will require a newer release of Bolt for bolt_spec to work.
60
- puppet_version = ENV['PUPPET_GEM_VERSION'] || '= 6.0.0'
61
- facter_version = ENV['FACTER_GEM_VERSION']
62
- hiera_version = ENV['HIERA_GEM_VERSION']
63
-
64
- gems = {}
65
-
66
- # If facter or hiera versions have been specified via the environment
67
- # variables
68
-
69
- gems['facter'] = location_for(facter_version) if facter_version
70
- gems['hiera'] = location_for(hiera_version) if hiera_version
71
- gems['puppet'] = location_for(puppet_version) if puppet_version
72
- gem 'bolt', '~> 0.23.0'
73
-
74
- if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
75
- # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
76
- # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
77
- gems['win32-dir'] = ['<= 0.4.9', require: false]
78
- gems['win32-eventlog'] = ['<= 0.6.5', require: false]
79
- gems['win32-process'] = ['<= 0.7.5', require: false]
80
- gems['win32-security'] = ['<= 0.2.5', require: false]
81
- gems['win32-service'] = ['0.8.8', require: false]
82
- end
83
-
84
- gems.each do |gem_name, gem_params|
85
- gem gem_name, *gem_params
86
- end
87
-
88
- # Evaluate Gemfile.local and ~/.gemfile if they exist
89
- extra_gemfiles = ["#{__FILE__}.local", File.join(Dir.home, '.gemfile')]
90
-
91
- extra_gemfiles.each do |gemfile|
92
- # rubocop:disable Security/Eval
93
- if File.file?(gemfile) && File.readable?(gemfile)
94
- eval(File.read(gemfile), binding)
95
- end
96
- # rubocop:enable Security/Eval
97
- end
98
- # vim: syntax=ruby
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.