mixlib-install 2.1.2 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7dbbaa531b4d85be6a4198ed08627cdc38804b3
4
- data.tar.gz: 47b854df4365270e6566bb04ae322d52d10f1abb
3
+ metadata.gz: d424a33019d3bd912eefa7331d2dd448ae56d648
4
+ data.tar.gz: b0ea47fa486e2022d427652dd8d5a7540ea614c4
5
5
  SHA512:
6
- metadata.gz: 9b27240f21cc8480fad46114f6c6a3546b670728a9180f3216e3c8a330488132a83c2ac8bbd6031d6c220fa451dc97e8ed7c18536858c32a74919554d734cba8
7
- data.tar.gz: 6414e414b71fabea427c5c4fb75f65e1d62516942ed79a5da8e866c7209f9e5aa291ae8cf0c6871d8ed298682f2f47fb33f20cd9ccdd623c7755852d6124c2b3
6
+ metadata.gz: 54e75ad628d8ca9b39f2e0e02ef40b25c8eb754bb70c4ce075e610161436bb1a07318307dfb18c50e9412cb035739767e0e222c74f18cfd835283ab404ac06c2
7
+ data.tar.gz: 19226b6e4115a5c0e8b9c272cfc150281f33528ddd1d3440110ed1d941a4308f559df3b0d16e0a63d9f19d43d522c56e8a1454af0ea1128c690ac18af1246d5d
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## [2.1.3]
4
+ - Collection of software dependencies and license content is now configurable. Disabled by default.
5
+
3
6
  ## [2.1.2]
4
7
  - Add Cumulus Linux and Cumulus Networks platform support
5
8
  - Fix Arista EOS platform detection ordering
data/README.md CHANGED
@@ -103,6 +103,33 @@ Mixlib::Install.available_versions("chef", "stable")
103
103
  # => ["12.13.3", "12.13.7"]
104
104
  ```
105
105
 
106
+ ### Collecting Software Dependencies and License Content
107
+ Collecting software dependencies and license content for ArtifactInfo instances
108
+ requires additional requests to the repository server. By default, collection is disabled.
109
+ To return that data for instances methods `software_dependencies` and `license_content`, the `include_metadata` option must be enabled.
110
+
111
+ ```
112
+ options = {
113
+ channel: :current,
114
+ product_name: 'chef',
115
+ product_version: :latest,
116
+ platform: 'mac_os_x',
117
+ platform_version: '10.9',
118
+ architecture: 'x86_64',
119
+ include_metadata: true,
120
+ }
121
+
122
+ artifact = Mixlib::Install.new(options).artifact_info
123
+
124
+ artifact.license_content.class
125
+ # => String
126
+ artifact.software_dependencies.class
127
+ # => Hash
128
+
129
+ # By default, the instance methods return nil
130
+
131
+ ```
132
+
106
133
  ## Development
107
134
  VCR is a tool that helps cache and replay http responses. When these responses change or when you add more tests you might need to update cached responses. Check out [spec_helper.rb](https://github.com/chef/mixlib-install/blob/master/spec/spec_helper.rb) for instructions on how to do this.
108
135
 
@@ -174,17 +174,21 @@ Can not find any builds for #{options.product_name} in #{endpoint}.
174
174
  artifact_map["filename"]
175
175
  )
176
176
 
177
- # retrieve the metadata using the standardized path
178
- begin
179
- metadata = get("#{chef_standard_path}.metadata.json")
180
- license_content = metadata["license_content"]
181
- software_dependencies = metadata["version_manifest"]["software"]
182
- rescue Net::HTTPServerException => e
183
- if e.message =~ /404/
184
- license_content, software_dependencies = nil
185
- else
186
- raise e
177
+ if options.include_metadata?
178
+ # retrieve the metadata using the standardized path
179
+ begin
180
+ metadata = get("#{chef_standard_path}.metadata.json")
181
+ license_content = metadata["license_content"]
182
+ software_dependencies = metadata["version_manifest"]["software"]
183
+ rescue Net::HTTPServerException => e
184
+ if e.message =~ /404/
185
+ license_content, software_dependencies = nil
186
+ else
187
+ raise e
188
+ end
187
189
  end
190
+ else
191
+ license_content, software_dependencies = nil
188
192
  end
189
193
 
190
194
  # create the download path with the correct endpoint
@@ -38,6 +38,7 @@ module Mixlib
38
38
  :product_version,
39
39
  :shell_type,
40
40
  :platform_version_compatibility_mode,
41
+ :include_metadata,
41
42
  ]
42
43
 
43
44
  def initialize(options)
@@ -76,6 +77,10 @@ module Mixlib
76
77
  product_version.to_sym == :latest
77
78
  end
78
79
 
80
+ def include_metadata?
81
+ include_metadata.to_s == "true"
82
+ end
83
+
79
84
  #
80
85
  # Set the platform info on the instance
81
86
  # info [Hash]
@@ -96,6 +101,7 @@ module Mixlib
96
101
  shell_type: :sh,
97
102
  platform_version_compatibility_mode: false,
98
103
  product_version: :latest,
104
+ include_metadata: false,
99
105
  }
100
106
  end
101
107
 
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "2.1.2"
3
+ VERSION = "2.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May