pdk 1.14.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/lib/pdk.rb +63 -8
- data/lib/pdk/analytics.rb +14 -28
- data/lib/pdk/analytics/client/google_analytics.rb +2 -0
- data/lib/pdk/analytics/client/noop.rb +2 -0
- data/lib/pdk/analytics/util.rb +2 -0
- data/lib/pdk/answer_file.rb +2 -21
- data/lib/pdk/cli.rb +25 -13
- data/lib/pdk/cli/errors.rb +2 -0
- data/lib/pdk/cli/exec.rb +5 -0
- data/lib/pdk/cli/exec/command.rb +10 -6
- data/lib/pdk/cli/exec/interactive_command.rb +1 -1
- data/lib/pdk/cli/exec_group.rb +2 -0
- data/lib/pdk/cli/module/generate.rb +1 -1
- data/lib/pdk/cli/new/module.rb +8 -1
- data/lib/pdk/cli/new/test.rb +0 -1
- data/lib/pdk/cli/test/unit.rb +0 -3
- data/lib/pdk/cli/util.rb +24 -13
- data/lib/pdk/cli/util/command_redirector.rb +3 -2
- data/lib/pdk/cli/util/interview.rb +2 -1
- data/lib/pdk/cli/util/option_normalizer.rb +2 -0
- data/lib/pdk/cli/util/option_validator.rb +2 -0
- data/lib/pdk/cli/validate.rb +0 -1
- data/lib/pdk/config.rb +19 -13
- data/lib/pdk/config/json.rb +1 -1
- data/lib/pdk/config/json_schema_namespace.rb +3 -4
- data/lib/pdk/config/json_schema_setting.rb +1 -1
- data/lib/pdk/config/json_with_schema.rb +1 -2
- data/lib/pdk/config/namespace.rb +2 -0
- data/lib/pdk/config/setting.rb +2 -0
- data/lib/pdk/config/validator.rb +31 -0
- data/lib/pdk/config/yaml.rb +1 -2
- data/lib/pdk/config/yaml_with_schema.rb +1 -1
- data/lib/pdk/generate.rb +19 -13
- data/lib/pdk/generate/defined_type.rb +1 -1
- data/lib/pdk/generate/module.rb +1 -1
- data/lib/pdk/generate/provider.rb +2 -2
- data/lib/pdk/generate/puppet_class.rb +1 -1
- data/lib/pdk/generate/puppet_object.rb +2 -0
- data/lib/pdk/generate/task.rb +1 -1
- data/lib/pdk/generate/transport.rb +1 -1
- data/lib/pdk/logger.rb +1 -4
- data/lib/pdk/module.rb +7 -0
- data/lib/pdk/module/build.rb +2 -0
- data/lib/pdk/module/convert.rb +2 -0
- data/lib/pdk/module/metadata.rb +2 -1
- data/lib/pdk/module/templatedir.rb +2 -0
- data/lib/pdk/module/update.rb +1 -1
- data/lib/pdk/module/update_manager.rb +2 -0
- data/lib/pdk/report.rb +3 -1
- data/lib/pdk/report/event.rb +2 -0
- data/lib/pdk/template_file.rb +1 -0
- data/lib/pdk/tests/unit.rb +8 -3
- data/lib/pdk/util.rb +25 -7
- data/lib/pdk/util/bundler.rb +2 -0
- data/lib/pdk/util/env.rb +30 -0
- data/lib/pdk/util/filesystem.rb +4 -1
- data/lib/pdk/util/git.rb +3 -1
- data/lib/pdk/util/puppet_strings.rb +4 -2
- data/lib/pdk/util/puppet_version.rb +11 -1
- data/lib/pdk/util/ruby_version.rb +1 -0
- data/lib/pdk/util/template_uri.rb +2 -0
- data/lib/pdk/util/vendored_file.rb +2 -0
- data/lib/pdk/util/version.rb +2 -0
- data/lib/pdk/util/windows.rb +1 -0
- data/lib/pdk/util/windows/api_types.rb +32 -0
- data/lib/pdk/util/windows/process.rb +79 -0
- data/lib/pdk/validate.rb +24 -5
- data/lib/pdk/validate/base_validator.rb +2 -0
- data/lib/pdk/validate/metadata/metadata_json_lint.rb +1 -1
- data/lib/pdk/validate/metadata/metadata_syntax.rb +1 -1
- data/lib/pdk/validate/metadata_validator.rb +1 -3
- data/lib/pdk/validate/puppet/puppet_epp.rb +2 -2
- data/lib/pdk/validate/puppet/puppet_lint.rb +1 -1
- data/lib/pdk/validate/puppet/puppet_syntax.rb +2 -2
- data/lib/pdk/validate/puppet_validator.rb +1 -4
- data/lib/pdk/validate/ruby/rubocop.rb +1 -1
- data/lib/pdk/validate/ruby_validator.rb +1 -2
- data/lib/pdk/validate/tasks/metadata_lint.rb +1 -1
- data/lib/pdk/validate/tasks/name.rb +1 -1
- data/lib/pdk/validate/tasks_validator.rb +1 -3
- data/lib/pdk/validate/yaml/syntax.rb +1 -1
- data/lib/pdk/validate/yaml_validator.rb +1 -2
- data/lib/pdk/version.rb +1 -1
- data/locales/pdk.pot +243 -207
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7118858cde5b6a4ea492a22683a8a077386d31e00157469186a373f91d8559
|
4
|
+
data.tar.gz: 4feab9cf89fd58a0c4023d04905efaccb56021dc7f44d0110b332de0fd1c7781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e8e385a5f17a12dd36d3d6938ee601e0020b0e8b55603ec409d111cd0add4f5b748c1cc493b7612d02381d1832d56ab7de7c933ab85c9773eee463e9c60dc9
|
7
|
+
data.tar.gz: 33063bc92b0d8678cf2ac33333e23a1c3ca2d51bfece32eb326376f8681334e8b9574cf9a9df9c19da931248afc88197c0367e4659a81df9b96fca3ab6ba74fa
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,37 @@ All changes to this repo will be documented in this file.
|
|
4
4
|
See the [release notes](https://puppet.com/docs/pdk/latest/release_notes.html) for a high-level summary.
|
5
5
|
|
6
6
|
|
7
|
+
## [v1.14.1](https://github.com/puppetlabs/pdk/tree/v1.14.1) (2019-11-01)
|
8
|
+
[Full Changelog](https://github.com/puppetlabs/pdk/compare/v1.14.0...v1.14.1)
|
9
|
+
|
10
|
+
**Fixed bugs:**
|
11
|
+
|
12
|
+
- "pdk validate" fails with "uninitialized constant PDK::VERSION \(NameError\)" [\#786](https://github.com/puppetlabs/pdk/issues/786)
|
13
|
+
- Networking facts missing for RHEL7 and facter 2.x [\#776](https://github.com/puppetlabs/pdk/issues/776)
|
14
|
+
- 'pdk test unit --verbose' does not change the rspec output format [\#773](https://github.com/puppetlabs/pdk/issues/773)
|
15
|
+
- rake build gives error NoMethodError: undefined method `package\_install?' for PDK::Util:Module [\#770](https://github.com/puppetlabs/pdk/issues/770)
|
16
|
+
- PDK::Util.in\_module\_root? can give a false positive result [\#768](https://github.com/puppetlabs/pdk/issues/768)
|
17
|
+
- pdk console --puppet-dev does not grab latest Puppet source [\#764](https://github.com/puppetlabs/pdk/issues/764)
|
18
|
+
- \(PDK-1527\) Handle pdk new module --skip-interview without module name [\#788](https://github.com/puppetlabs/pdk/pull/788) ([rodjek](https://github.com/rodjek))
|
19
|
+
|
20
|
+
**Merged pull requests:**
|
21
|
+
|
22
|
+
- \(maint\) Raise error when template content is empty or nil [\#794](https://github.com/puppetlabs/pdk/pull/794) ([rodjek](https://github.com/rodjek))
|
23
|
+
- \(PDK-1530\) Disable schema validation of config files [\#793](https://github.com/puppetlabs/pdk/pull/793) ([glennsarti](https://github.com/glennsarti))
|
24
|
+
- \(\#764\) Ensure --puppet-dev checkout is always updated [\#792](https://github.com/puppetlabs/pdk/pull/792) ([rodjek](https://github.com/rodjek))
|
25
|
+
- \(\#773\) Respect --verbose in interactive pdk test unit [\#791](https://github.com/puppetlabs/pdk/pull/791) ([rodjek](https://github.com/rodjek))
|
26
|
+
- \(PDK-1443\) Windows safe Tempfiles & environment variable access [\#790](https://github.com/puppetlabs/pdk/pull/790) ([rodjek](https://github.com/rodjek))
|
27
|
+
- \(maint\) Use same rspec pattern in acceptance suite [\#789](https://github.com/puppetlabs/pdk/pull/789) ([glennsarti](https://github.com/glennsarti))
|
28
|
+
- \(PDK-1519\) Print deprecation notice on Ruby \< 2.4 [\#785](https://github.com/puppetlabs/pdk/pull/785) ([rodjek](https://github.com/rodjek))
|
29
|
+
- \(maint\) Setup autoloads for TTY::Prompt [\#784](https://github.com/puppetlabs/pdk/pull/784) ([rtib](https://github.com/rtib))
|
30
|
+
- \(GH-768\) Fix in\_module\_root? gives false positives [\#783](https://github.com/puppetlabs/pdk/pull/783) ([glennsarti](https://github.com/glennsarti))
|
31
|
+
- \(maint\) Run acceptance:local tests in parallel during CI [\#781](https://github.com/puppetlabs/pdk/pull/781) ([rodjek](https://github.com/rodjek))
|
32
|
+
- \(MAINT\) Fix new provider error message [\#780](https://github.com/puppetlabs/pdk/pull/780) ([michaeltlombardi](https://github.com/michaeltlombardi))
|
33
|
+
- \(PDK-1525\) Use less restrictive minitar version [\#779](https://github.com/puppetlabs/pdk/pull/779) ([glennsarti](https://github.com/glennsarti))
|
34
|
+
- \(maint\) PDK as a library [\#778](https://github.com/puppetlabs/pdk/pull/778) ([rodjek](https://github.com/rodjek))
|
35
|
+
- \(PDK-1517\) Bump version to 1.15.0.pre [\#772](https://github.com/puppetlabs/pdk/pull/772) ([scotje](https://github.com/scotje))
|
36
|
+
- \(\#770\) Add missing require to PDK::Module::Metadata.from\_file [\#771](https://github.com/puppetlabs/pdk/pull/771) ([hajee](https://github.com/hajee))
|
37
|
+
|
7
38
|
## [v1.14.0](https://github.com/puppetlabs/pdk/tree/v1.14.0) (2019-10-09)
|
8
39
|
[Full Changelog](https://github.com/puppetlabs/pdk/compare/v1.13.0...v1.14.0)
|
9
40
|
|
data/lib/pdk.rb
CHANGED
@@ -1,12 +1,67 @@
|
|
1
|
-
require 'pdk/analytics'
|
2
|
-
require 'pdk/answer_file'
|
3
|
-
require 'pdk/config'
|
4
|
-
require 'pdk/generate'
|
5
1
|
require 'pdk/i18n'
|
6
|
-
require 'pdk/logger'
|
7
|
-
require 'pdk/report'
|
8
|
-
require 'pdk/validate'
|
9
|
-
require 'pdk/version'
|
10
2
|
|
11
3
|
module PDK
|
4
|
+
autoload :Analytics, 'pdk/analytics'
|
5
|
+
autoload :AnswerFile, 'pdk/answer_file'
|
6
|
+
autoload :Config, 'pdk/config'
|
7
|
+
autoload :Generate, 'pdk/generate'
|
8
|
+
autoload :Logger, 'pdk/logger'
|
9
|
+
autoload :Module, 'pdk/module'
|
10
|
+
autoload :Report, 'pdk/report'
|
11
|
+
autoload :TemplateFile, 'pdk/template_file'
|
12
|
+
autoload :TEMPLATE_REF, 'pdk/version'
|
13
|
+
autoload :Util, 'pdk/util'
|
14
|
+
autoload :Validate, 'pdk/validate'
|
15
|
+
autoload :VERSION, 'pdk/version'
|
16
|
+
|
17
|
+
# TODO: Refactor backend code to not raise CLI errors or use CLI util
|
18
|
+
# methods.
|
19
|
+
module CLI
|
20
|
+
autoload :ExitWithError, 'pdk/cli/errors'
|
21
|
+
autoload :FatalError, 'pdk/cli/errors'
|
22
|
+
autoload :Util, 'pdk/cli/util'
|
23
|
+
autoload :Exec, 'pdk/cli/exec'
|
24
|
+
autoload :ExecGroup, 'pdk/cli/exec_group'
|
25
|
+
end
|
26
|
+
|
27
|
+
module Test
|
28
|
+
autoload :Unit, 'pdk/tests/unit'
|
29
|
+
end
|
30
|
+
|
31
|
+
# Singleton accessor to the current answer file being used by the PDK.
|
32
|
+
#
|
33
|
+
# @return [PDK::AnswerFile] The AnswerFile instance currently being used by
|
34
|
+
# the PDK.
|
35
|
+
def self.answers
|
36
|
+
@answer_file ||= PDK::AnswerFile.new
|
37
|
+
end
|
38
|
+
|
39
|
+
# Specify the path to a custom answer file that the PDK should use.
|
40
|
+
#
|
41
|
+
# @param path [String] A path on disk to the file where the PDK should store
|
42
|
+
# answers to interactive questions.
|
43
|
+
def self.answer_file=(path)
|
44
|
+
@answer_file = PDK::AnswerFile.new(path)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.logger
|
48
|
+
@logger ||= PDK::Logger.new
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.config
|
52
|
+
@config ||= PDK::Config.new
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.analytics
|
56
|
+
@analytics ||= PDK::Analytics.build_client(
|
57
|
+
logger: PDK.logger,
|
58
|
+
disabled: PDK::Util::Env['PDK_DISABLE_ANALYTICS'] || PDK.config.user['analytics']['disabled'],
|
59
|
+
user_id: PDK.config.user['analytics']['user-id'],
|
60
|
+
app_id: "UA-139917834-#{PDK::Util.development_mode? ? '2' : '1'}",
|
61
|
+
client: :google_analytics,
|
62
|
+
app_name: 'pdk',
|
63
|
+
app_version: PDK::VERSION,
|
64
|
+
app_installer: PDK::Util.package_install? ? 'package' : 'gem',
|
65
|
+
)
|
66
|
+
end
|
12
67
|
end
|
data/lib/pdk/analytics.rb
CHANGED
@@ -1,30 +1,15 @@
|
|
1
|
-
require 'pdk
|
2
|
-
require 'pdk/analytics/client/noop'
|
1
|
+
require 'pdk'
|
3
2
|
|
4
|
-
|
5
|
-
def self.analytics
|
6
|
-
require 'pdk/config'
|
7
|
-
require 'pdk/logger'
|
8
|
-
require 'pdk/util'
|
9
|
-
require 'pdk/version'
|
10
|
-
|
11
|
-
@analytics ||= PDK::Analytics.build_client(
|
12
|
-
logger: PDK.logger,
|
13
|
-
disabled: ENV['PDK_DISABLE_ANALYTICS'] || PDK.config.user['analytics']['disabled'],
|
14
|
-
user_id: PDK.config.user['analytics']['user-id'],
|
15
|
-
app_id: "UA-139917834-#{PDK::Util.development_mode? ? '2' : '1'}",
|
16
|
-
client: :google_analytics,
|
17
|
-
app_name: 'pdk',
|
18
|
-
app_version: PDK::VERSION,
|
19
|
-
app_installer: PDK::Util.package_install? ? 'package' : 'gem',
|
20
|
-
)
|
21
|
-
end
|
3
|
+
autoload :Logger, 'logger'
|
22
4
|
|
5
|
+
module PDK
|
23
6
|
module Analytics
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
7
|
+
autoload :Util, 'pdk/analytics/util'
|
8
|
+
|
9
|
+
module Client
|
10
|
+
autoload :Noop, 'pdk/analytics/client/noop'
|
11
|
+
autoload :GoogleAnalytics, 'pdk/analytics/client/google_analytics'
|
12
|
+
end
|
28
13
|
|
29
14
|
def self.build_client(opts = {})
|
30
15
|
opts[:logger] ||= ::Logger.new(STDERR)
|
@@ -32,13 +17,14 @@ module PDK
|
|
32
17
|
|
33
18
|
if opts[:disabled]
|
34
19
|
opts[:logger].debug 'Analytics opt-out is set, analytics will be disabled'
|
35
|
-
|
36
|
-
else
|
37
|
-
CLIENTS[opts[:client]].new(opts)
|
20
|
+
opts[:client] = :noop
|
38
21
|
end
|
22
|
+
|
23
|
+
client_const = opts[:client].to_s.split('_').map(&:capitalize).join
|
24
|
+
PDK::Analytics::Client.const_get(client_const).new(opts)
|
39
25
|
rescue StandardError => e
|
40
26
|
opts[:logger].debug "Failed to initialize analytics client, analytics will be disabled: #{e}"
|
41
|
-
|
27
|
+
PDK::Analytics::Client::Noop.new(opts)
|
42
28
|
end
|
43
29
|
end
|
44
30
|
end
|
data/lib/pdk/analytics/util.rb
CHANGED
data/lib/pdk/answer_file.rb
CHANGED
@@ -1,22 +1,7 @@
|
|
1
|
-
require 'pdk
|
1
|
+
require 'pdk'
|
2
|
+
autoload :JSON, 'json'
|
2
3
|
|
3
4
|
module PDK
|
4
|
-
# Singleton accessor to the current answer file being used by the PDK.
|
5
|
-
#
|
6
|
-
# @return [PDK::AnswerFile] The AnswerFile instance currently being used by
|
7
|
-
# the PDK.
|
8
|
-
def self.answers
|
9
|
-
@answer_file ||= PDK::AnswerFile.new
|
10
|
-
end
|
11
|
-
|
12
|
-
# Specify the path to a custom answer file that the PDK should use.
|
13
|
-
#
|
14
|
-
# @param path [String] A path on disk to the file where the PDK should store
|
15
|
-
# answers to interactive questions.
|
16
|
-
def self.answer_file=(path)
|
17
|
-
@answer_file = PDK::AnswerFile.new(path)
|
18
|
-
end
|
19
|
-
|
20
5
|
class AnswerFile
|
21
6
|
attr_reader :answers
|
22
7
|
attr_reader :answer_file_path
|
@@ -79,8 +64,6 @@ module PDK
|
|
79
64
|
#
|
80
65
|
# @return [Hash{String => Object}] The existing questions and answers.
|
81
66
|
def read_from_disk
|
82
|
-
require 'json'
|
83
|
-
|
84
67
|
return {} if !File.file?(answer_file_path) || File.zero?(answer_file_path)
|
85
68
|
|
86
69
|
unless File.readable?(answer_file_path)
|
@@ -109,8 +92,6 @@ module PDK
|
|
109
92
|
#
|
110
93
|
# @raise [PDK::CLI::FatalError] if the answer file can not be written to.
|
111
94
|
def save_to_disk
|
112
|
-
require 'json'
|
113
|
-
|
114
95
|
FileUtils.mkdir_p(File.dirname(answer_file_path))
|
115
96
|
|
116
97
|
write_file(answer_file_path, JSON.pretty_generate(answers))
|
data/lib/pdk/cli.rb
CHANGED
@@ -1,18 +1,12 @@
|
|
1
1
|
require 'cri'
|
2
2
|
|
3
|
-
require 'pdk
|
3
|
+
require 'pdk'
|
4
4
|
require 'pdk/cli/errors'
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require 'pdk/i18n'
|
11
|
-
require 'pdk/logger'
|
12
|
-
require 'pdk/report'
|
13
|
-
require 'pdk/util/version'
|
14
|
-
require 'pdk/util/puppet_version'
|
15
|
-
require 'pdk/util/filesystem'
|
5
|
+
|
6
|
+
module TTY
|
7
|
+
autoload :Prompt, 'tty/prompt'
|
8
|
+
autoload :TestPrompt, 'tty/test_prompt'
|
9
|
+
end
|
16
10
|
|
17
11
|
class Cri::Command::CriExitException
|
18
12
|
def initialize(is_error:)
|
@@ -22,6 +16,8 @@ class Cri::Command::CriExitException
|
|
22
16
|
end
|
23
17
|
|
24
18
|
module PDK::CLI
|
19
|
+
autoload :Util, 'pdk/cli/util'
|
20
|
+
|
25
21
|
# Attempt to anonymise the raw ARGV array if the command parsing failed.
|
26
22
|
#
|
27
23
|
# If an item does not start with '-' but is preceeded by an item that does
|
@@ -50,9 +46,25 @@ module PDK::CLI
|
|
50
46
|
end
|
51
47
|
end
|
52
48
|
|
49
|
+
def self.deprecated_runtime?
|
50
|
+
Gem::Version.new(RbConfig::CONFIG['ruby_version']) < Gem::Version.new('2.4.0')
|
51
|
+
end
|
52
|
+
|
53
53
|
def self.run(args)
|
54
|
+
if deprecated_runtime?
|
55
|
+
PDK.logger.info(
|
56
|
+
text: _(
|
57
|
+
'Support for Ruby versions older than 2.4 will be dropped in the ' \
|
58
|
+
'future PDK 2.0.0 release. We recommend updating your Ruby ' \
|
59
|
+
'installation to ensure that you can continue using the latest ' \
|
60
|
+
'version of PDK.',
|
61
|
+
),
|
62
|
+
wrap: true,
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
54
66
|
@args = args
|
55
|
-
PDK::Config.analytics_config_interview! unless
|
67
|
+
PDK::Config.analytics_config_interview! unless PDK::Util::Env['PDK_DISABLE_ANALYTICS'] || PDK::Config.analytics_config_exist?
|
56
68
|
@base_cmd.run(args)
|
57
69
|
rescue PDK::CLI::ExitWithError => e
|
58
70
|
PDK.logger.send(e.log_level, e.message)
|
data/lib/pdk/cli/errors.rb
CHANGED
data/lib/pdk/cli/exec.rb
CHANGED
data/lib/pdk/cli/exec/command.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pdk'
|
2
|
+
|
1
3
|
module PDK
|
2
4
|
module CLI
|
3
5
|
module Exec
|
@@ -8,6 +10,8 @@ module PDK
|
|
8
10
|
attr_accessor :environment
|
9
11
|
attr_writer :exec_group
|
10
12
|
|
13
|
+
TEMPFILE_MODE = File::RDWR | File::BINARY | File::CREAT | File::TRUNC
|
14
|
+
|
11
15
|
def initialize(*argv)
|
12
16
|
require 'childprocess'
|
13
17
|
require 'tempfile'
|
@@ -17,8 +21,8 @@ module PDK
|
|
17
21
|
@process = ChildProcess.build(*@argv)
|
18
22
|
@process.leader = true
|
19
23
|
|
20
|
-
@stdout = Tempfile.new('stdout').tap { |io| io.sync = true }
|
21
|
-
@stderr = Tempfile.new('stderr').tap { |io| io.sync = true }
|
24
|
+
@stdout = Tempfile.new('stdout', mode: TEMPFILE_MODE).tap { |io| io.sync = true }
|
25
|
+
@stderr = Tempfile.new('stderr', mode: TEMPFILE_MODE).tap { |io| io.sync = true }
|
22
26
|
|
23
27
|
@process.io.stdout = @stdout
|
24
28
|
@process.io.stderr = @stderr
|
@@ -124,7 +128,7 @@ module PDK
|
|
124
128
|
protected
|
125
129
|
|
126
130
|
def warn_on_legacy_env_vars!
|
127
|
-
if
|
131
|
+
if PDK::Util::Env['PUPPET_GEM_VERSION']
|
128
132
|
PDK.logger.warn_once _(
|
129
133
|
'PUPPET_GEM_VERSION is not supported by PDK. ' \
|
130
134
|
'Use the --puppet-version option on your PDK command ' \
|
@@ -133,7 +137,7 @@ module PDK
|
|
133
137
|
end
|
134
138
|
|
135
139
|
%w[FACTER HIERA].each do |gem|
|
136
|
-
if
|
140
|
+
if PDK::Util::Env["#{gem}_GEM_VERSION"]
|
137
141
|
PDK.logger.warn_once _('%{varname} is not supported by PDK.') % { varname: "#{gem}_GEM_VERSION" }
|
138
142
|
end
|
139
143
|
end
|
@@ -144,7 +148,7 @@ module PDK
|
|
144
148
|
|
145
149
|
resolved_env = {}
|
146
150
|
|
147
|
-
resolved_env['TERM'] =
|
151
|
+
resolved_env['TERM'] = PDK::Util::Env['TERM']
|
148
152
|
resolved_env['PUPPET_GEM_VERSION'] = nil
|
149
153
|
resolved_env['FACTER_GEM_VERSION'] = nil
|
150
154
|
resolved_env['HIERA_GEM_VERSION'] = nil
|
@@ -170,7 +174,7 @@ module PDK
|
|
170
174
|
PDK::Util::RubyVersion.gem_paths_raw.map { |gem_path| File.join(gem_path, 'bin') },
|
171
175
|
package_binpath,
|
172
176
|
PDK::Util.package_install? ? PDK::Util::Git.git_paths : nil,
|
173
|
-
|
177
|
+
PDK::Util::Env['PATH'],
|
174
178
|
].compact.flatten.join(File::PATH_SEPARATOR)
|
175
179
|
end
|
176
180
|
|
data/lib/pdk/cli/exec_group.rb
CHANGED
data/lib/pdk/cli/new/module.rb
CHANGED
@@ -28,7 +28,14 @@ module PDK::CLI
|
|
28
28
|
opts[:'full-interview'] = false
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
if module_name.nil? || module_name.empty?
|
32
|
+
if opts[:'skip-interview']
|
33
|
+
raise PDK::CLI::ExitWithError, _(
|
34
|
+
'You must specify a module name on the command line when running ' \
|
35
|
+
'with --skip-interview.',
|
36
|
+
)
|
37
|
+
end
|
38
|
+
else
|
32
39
|
module_name_parts = module_name.split('-', 2)
|
33
40
|
if module_name_parts.size > 1
|
34
41
|
opts[:username] = module_name_parts[0]
|
data/lib/pdk/cli/new/test.rb
CHANGED
@@ -33,7 +33,6 @@ module PDK::CLI
|
|
33
33
|
end
|
34
34
|
|
35
35
|
puppet_env = PDK::CLI::Util.puppet_from_opts_or_env(opts)
|
36
|
-
PDK::Util::PuppetVersion.fetch_puppet_dev if opts[:'puppet-dev']
|
37
36
|
PDK::Util::RubyVersion.use(puppet_env[:ruby_version])
|
38
37
|
PDK::Util::Bundler.ensure_bundle!(puppet_env[:gemset])
|
39
38
|
|
data/lib/pdk/cli/test/unit.rb
CHANGED
@@ -37,7 +37,6 @@ module PDK::CLI
|
|
37
37
|
|
38
38
|
# Ensure that the bundled gems are up to date and correct Ruby is activated before running or listing tests.
|
39
39
|
puppet_env = PDK::CLI::Util.puppet_from_opts_or_env(opts)
|
40
|
-
PDK::Util::PuppetVersion.fetch_puppet_dev if opts[:'puppet-dev']
|
41
40
|
PDK::Util::RubyVersion.use(puppet_env[:ruby_version])
|
42
41
|
|
43
42
|
opts.merge!(puppet_env[:gemset])
|
@@ -66,8 +65,6 @@ module PDK::CLI
|
|
66
65
|
end
|
67
66
|
end
|
68
67
|
else
|
69
|
-
PDK.logger.info _('--verbose has no effect when not used with --list') if opts[:verbose]
|
70
|
-
|
71
68
|
report = PDK::Report.new
|
72
69
|
report_formats = if opts[:format]
|
73
70
|
opts[:interactive] = false
|