puppet 5.5.20 → 5.5.21
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +19 -19
- data/lib/puppet/agent.rb +3 -3
- data/lib/puppet/application/agent.rb +3 -1
- data/lib/puppet/daemon.rb +1 -1
- data/lib/puppet/defaults.rb +2 -2
- data/lib/puppet/file_system/uniquefile.rb +4 -0
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
- data/lib/puppet/network/http/api/master/v3/environment.rb +3 -0
- data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +2 -0
- data/lib/puppet/parser/compiler/catalog_validator/site_validator.rb +2 -0
- data/lib/puppet/parser/environment_compiler.rb +3 -0
- data/lib/puppet/parser/resource.rb +3 -2
- data/lib/puppet/parser/resource/param.rb +6 -0
- data/lib/puppet/pops/issues.rb +5 -0
- data/lib/puppet/pops/resource/resource_type_impl.rb +2 -0
- data/lib/puppet/pops/validation/checker4_0.rb +10 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -0
- data/lib/puppet/provider/package/dnfmodule.rb +24 -4
- data/lib/puppet/provider/package/pip.rb +6 -4
- data/lib/puppet/provider/package/zypper.rb +1 -0
- data/lib/puppet/provider/service/systemd.rb +22 -4
- data/lib/puppet/provider/user/useradd.rb +16 -5
- data/lib/puppet/resource/type.rb +8 -0
- data/lib/puppet/test/test_helper.rb +8 -10
- data/lib/puppet/type.rb +6 -0
- data/lib/puppet/type/package.rb +16 -1
- data/lib/puppet/type/service.rb +1 -7
- data/lib/puppet/type/user.rb +1 -7
- data/lib/puppet/util.rb +12 -13
- data/lib/puppet/util/log/destinations.rb +1 -10
- data/lib/puppet/util/windows/api_types.rb +45 -32
- data/lib/puppet/util/windows/eventlog.rb +1 -6
- data/lib/puppet/util/windows/principal.rb +8 -6
- data/lib/puppet/util/windows/registry.rb +11 -11
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +97 -93
- data/man/man5/puppet.conf.5 +2 -2
- data/man/man8/puppet-agent.8 +2 -2
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/package/dnfmodule/{dnf-module-list-enabled.txt → dnf-module-list.txt} +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +9 -0
- data/spec/integration/defaults_spec.rb +1 -2
- data/spec/integration/parser/compiler_spec.rb +11 -0
- data/spec/integration/util/windows/adsi_spec.rb +5 -0
- data/spec/integration/util/windows/registry_spec.rb +7 -7
- data/spec/unit/agent_spec.rb +1 -1
- data/spec/unit/daemon_spec.rb +0 -1
- data/spec/unit/file_system/uniquefile_spec.rb +11 -0
- data/spec/unit/network/http/api/indirected_routes_spec.rb +2 -1
- data/spec/unit/parser/environment_compiler_spec.rb +7 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +25 -5
- data/spec/unit/provider/package/pip_spec.rb +42 -16
- data/spec/unit/provider/package/zypper_spec.rb +13 -0
- data/spec/unit/provider/service/systemd_spec.rb +93 -20
- data/spec/unit/provider/user/openbsd_spec.rb +1 -0
- data/spec/unit/provider/user/useradd_spec.rb +30 -16
- data/spec/unit/test/test_helper_spec.rb +17 -0
- data/spec/unit/type/service_spec.rb +9 -8
- data/spec/unit/type/user_spec.rb +19 -13
- data/spec/unit/util/log/destinations_spec.rb +1 -29
- data/spec/unit/util/windows/api_types_spec.rb +104 -40
- metadata +7 -7
- data/spec/integration/test/test_helper_spec.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90e0d66f006996d2e1696186adfd42a41b3e13eaa6bf9ef2c6807b8b63a75017
|
4
|
+
data.tar.gz: 150d06e79adfca72573842ddc751a8db13e0fa00e38bc5d96d77cefd6e4d9528
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5243ce174453e7e7cdf01e5c080c2eaeee9dc8bc7af0f5054669837e62f68f05368c477919d428660d5fce7759db34f72463f7d5c33ecbfbdfd20d5b5bd10973
|
7
|
+
data.tar.gz: 550da82fb9ff3ced0d64651f1484678d17d338920dbf72a314e3890da95e12193eaa2ab6ae2428504b9e649999845929953cf3511d83052e26e92b9bff6ab580
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puppet (5.5.
|
4
|
+
puppet (5.5.21)
|
5
5
|
CFPropertyList (~> 2.2)
|
6
6
|
facter (>= 2.4.0, < 4)
|
7
7
|
fast_gettext (~> 1.1.2)
|
@@ -17,13 +17,13 @@ GEM
|
|
17
17
|
CFPropertyList (2.3.6)
|
18
18
|
addressable (2.4.0)
|
19
19
|
artifactory (2.8.2)
|
20
|
-
ast (2.4.
|
20
|
+
ast (2.4.1)
|
21
21
|
builder (3.2.4)
|
22
|
-
coderay (1.1.
|
22
|
+
coderay (1.1.3)
|
23
23
|
crack (0.4.3)
|
24
24
|
safe_yaml (~> 1.0.0)
|
25
|
-
csv (3.1.
|
26
|
-
diff-lcs (1.
|
25
|
+
csv (3.1.5)
|
26
|
+
diff-lcs (1.4.4)
|
27
27
|
docopt (0.6.1)
|
28
28
|
facter (2.5.7)
|
29
29
|
fast_gettext (1.1.2)
|
@@ -40,7 +40,7 @@ GEM
|
|
40
40
|
highline (~> 1.6.19)
|
41
41
|
optimist
|
42
42
|
highline (1.6.21)
|
43
|
-
hocon (1.3.
|
43
|
+
hocon (1.3.1)
|
44
44
|
hpricot (0.8.6)
|
45
45
|
json-schema (2.8.1)
|
46
46
|
addressable (>= 2.4)
|
@@ -53,27 +53,27 @@ GEM
|
|
53
53
|
mustache (1.1.1)
|
54
54
|
net-ssh (4.2.0)
|
55
55
|
optimist (3.0.1)
|
56
|
-
packaging (0.99.
|
56
|
+
packaging (0.99.66)
|
57
57
|
artifactory (~> 2)
|
58
58
|
rake (>= 12.3)
|
59
59
|
release-metrics
|
60
|
-
parallel (1.19.
|
61
|
-
parser (2.7.1.
|
62
|
-
ast (~> 2.4.
|
60
|
+
parallel (1.19.2)
|
61
|
+
parser (2.7.1.4)
|
62
|
+
ast (~> 2.4.1)
|
63
63
|
pathspec (0.2.1)
|
64
64
|
powerpack (0.1.2)
|
65
65
|
pry (0.13.1)
|
66
66
|
coderay (~> 1.1)
|
67
67
|
method_source (~> 1.0)
|
68
68
|
puppet-lint (2.4.2)
|
69
|
-
puppet-syntax (
|
69
|
+
puppet-syntax (3.1.0)
|
70
70
|
puppet (>= 5)
|
71
71
|
rake
|
72
|
-
puppetlabs_spec_helper (2.
|
72
|
+
puppetlabs_spec_helper (2.15.0)
|
73
73
|
mocha (~> 1.0)
|
74
74
|
pathspec (~> 0.2.1)
|
75
75
|
puppet-lint (~> 2.0)
|
76
|
-
puppet-syntax (
|
76
|
+
puppet-syntax (>= 2.0, < 4)
|
77
77
|
rspec-puppet (~> 2.0)
|
78
78
|
racc (1.4.9)
|
79
79
|
rack (1.6.13)
|
@@ -95,9 +95,9 @@ GEM
|
|
95
95
|
rspec-mocks (~> 3.9.0)
|
96
96
|
rspec-collection_matchers (1.2.0)
|
97
97
|
rspec-expectations (>= 2.99.0.beta1)
|
98
|
-
rspec-core (3.9.
|
99
|
-
rspec-support (~> 3.9.
|
100
|
-
rspec-expectations (3.9.
|
98
|
+
rspec-core (3.9.2)
|
99
|
+
rspec-support (~> 3.9.3)
|
100
|
+
rspec-expectations (3.9.2)
|
101
101
|
diff-lcs (>= 1.2.0, < 2.0)
|
102
102
|
rspec-support (~> 3.9.0)
|
103
103
|
rspec-its (1.3.0)
|
@@ -110,7 +110,7 @@ GEM
|
|
110
110
|
rspec-support (~> 3.9.0)
|
111
111
|
rspec-puppet (2.7.8)
|
112
112
|
rspec
|
113
|
-
rspec-support (3.9.
|
113
|
+
rspec-support (3.9.3)
|
114
114
|
rubocop (0.49.1)
|
115
115
|
parallel (~> 1.10)
|
116
116
|
parser (>= 2.3.3.1, < 3.0)
|
@@ -120,7 +120,7 @@ GEM
|
|
120
120
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
121
121
|
rubocop-i18n (1.2.0)
|
122
122
|
rubocop (~> 0.49.0)
|
123
|
-
ruby-prof (1.
|
123
|
+
ruby-prof (1.4.1)
|
124
124
|
ruby-progressbar (1.10.1)
|
125
125
|
safe_yaml (1.0.5)
|
126
126
|
text (1.3.1)
|
@@ -130,7 +130,7 @@ GEM
|
|
130
130
|
addressable (>= 2.3.6)
|
131
131
|
crack (>= 0.3.2)
|
132
132
|
hashdiff
|
133
|
-
yard (0.9.
|
133
|
+
yard (0.9.25)
|
134
134
|
yarjuf (2.0.0)
|
135
135
|
builder
|
136
136
|
rspec (~> 3)
|
data/lib/puppet/agent.rb
CHANGED
@@ -61,15 +61,15 @@ class Puppet::Agent
|
|
61
61
|
end
|
62
62
|
rescue Puppet::LockError
|
63
63
|
Puppet.notice _("Run of %{client_class} already in progress; skipping (%{lockfile_path} exists)") % { client_class: client_class, lockfile_path: lockfile_path }
|
64
|
-
|
64
|
+
nil
|
65
65
|
rescue RunTimeoutError => detail
|
66
66
|
Puppet.log_exception(detail, _("Execution of %{client_class} did not complete within %{runtimeout} seconds and was terminated.") %
|
67
67
|
{client_class: client_class,
|
68
68
|
runtimeout: Puppet[:runtimeout]})
|
69
|
-
|
69
|
+
nil
|
70
70
|
rescue StandardError => detail
|
71
71
|
Puppet.log_exception(detail, _("Could not run %{client_class}: %{detail}") % { client_class: client_class, detail: detail })
|
72
|
-
|
72
|
+
nil
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -245,7 +245,9 @@ generated by running puppet agent with '--genconfig'.
|
|
245
245
|
|
246
246
|
* --job-id:
|
247
247
|
Attach the specified job id to the catalog request and the report used for
|
248
|
-
this agent run. This option only works when '--onetime' is used.
|
248
|
+
this agent run. This option only works when '--onetime' is used. When using
|
249
|
+
Puppet Enterprise this flag should not be used as the orchestrator sets the
|
250
|
+
job-id for you and it must be unique.
|
249
251
|
|
250
252
|
* --logdest:
|
251
253
|
Where to send log messages. Choose between 'syslog' (the POSIX syslog
|
data/lib/puppet/daemon.rb
CHANGED
data/lib/puppet/defaults.rb
CHANGED
@@ -1498,7 +1498,7 @@ EOT
|
|
1498
1498
|
:statefile => {
|
1499
1499
|
:default => "$statedir/state.yaml",
|
1500
1500
|
:type => :file,
|
1501
|
-
:mode => "
|
1501
|
+
:mode => "0640",
|
1502
1502
|
:desc => "Where puppet agent and puppet master store state associated
|
1503
1503
|
with the running configuration. In the case of puppet master,
|
1504
1504
|
this file reflects the state discovered through interacting
|
@@ -1520,7 +1520,7 @@ EOT
|
|
1520
1520
|
:transactionstorefile => {
|
1521
1521
|
:default => "$statedir/transactionstore.yaml",
|
1522
1522
|
:type => :file,
|
1523
|
-
:mode => "
|
1523
|
+
:mode => "0640",
|
1524
1524
|
:desc => "Transactional storage file for persisting data between
|
1525
1525
|
transactions for the purposes of infering information (such as
|
1526
1526
|
corrective_change) on new data received."
|
@@ -174,6 +174,10 @@ class Puppet::FileSystem::Uniquefile < DelegateClass(File)
|
|
174
174
|
lock = tmpname + '.lock'
|
175
175
|
mkdir(lock)
|
176
176
|
yield
|
177
|
+
rescue Errno::ENOENT => e
|
178
|
+
ex = Errno::ENOENT.new("A directory component in #{lock} does not exist or is a dangling symbolic link")
|
179
|
+
ex.set_backtrace(e.backtrace)
|
180
|
+
raise ex
|
177
181
|
ensure
|
178
182
|
rmdir(lock) if Puppet::FileSystem.exist?(lock)
|
179
183
|
end
|
@@ -210,7 +210,7 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
|
|
210
210
|
return formatter if formatter
|
211
211
|
|
212
212
|
raise Puppet::Network::HTTP::Error::HTTPNotAcceptableError.new(
|
213
|
-
_("No supported formats are acceptable (Accept: %{accepted_formats})") % { accepted_formats: formats },
|
213
|
+
_("No supported formats are acceptable (Accept: %{accepted_formats})") % { accepted_formats: formats.map(&:mime).join(', ') },
|
214
214
|
Puppet::Network::HTTP::Issues::UNSUPPORTED_FORMAT)
|
215
215
|
end
|
216
216
|
|
@@ -1,8 +1,11 @@
|
|
1
1
|
require 'puppet/util/json'
|
2
2
|
require 'puppet/parser/environment_compiler'
|
3
3
|
|
4
|
+
# @deprecated application orchestration will be removed in puppet 7
|
4
5
|
class Puppet::Network::HTTP::API::Master::V3::Environment
|
5
6
|
def call(request, response)
|
7
|
+
Puppet.deprecation_warning("Application orchestration is deprecated. See https://puppet.com/docs/puppet/5.5/deprecated_language.html")
|
8
|
+
|
6
9
|
env_name = request.routing_path.split('/').last
|
7
10
|
env = Puppet.lookup(:environments).get(env_name)
|
8
11
|
code_id = request.params[:code_id]
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class Puppet::Parser::Compiler
|
2
2
|
# Validator that asserts that all capability resources that are referenced by 'consume' or 'require' has
|
3
3
|
# been exported by some other resource in the environment
|
4
|
+
#
|
5
|
+
# @deprecated application orchestration will be removed in puppet 7
|
4
6
|
class CatalogValidator::EnvironmentRelationshipValidator < CatalogValidator
|
5
7
|
|
6
8
|
def validate
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class Puppet::Parser::Compiler
|
2
2
|
# Validator that asserts that only application components can appear inside a site.
|
3
|
+
#
|
4
|
+
# @deprecated application orchestration will be removed in puppet 7
|
3
5
|
class CatalogValidator::SiteValidator < CatalogValidator
|
4
6
|
def self.validation_stage?(stage)
|
5
7
|
PRE_FINISH.equal?(stage)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'puppet/parser/compiler'
|
2
2
|
|
3
|
+
# @deprecated application orchestration will be removed in puppet 7
|
3
4
|
class Puppet::Parser::EnvironmentCompiler < Puppet::Parser::Compiler
|
4
5
|
def self.compile(env, code_id=nil)
|
5
6
|
begin
|
@@ -54,6 +55,8 @@ class Puppet::Parser::EnvironmentCompiler < Puppet::Parser::Compiler
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def compile
|
58
|
+
Puppet.deprecation_warning("Application orchestration is deprecated. See https://puppet.com/docs/puppet/5.5/deprecated_language.html")
|
59
|
+
|
57
60
|
add_function_overrides
|
58
61
|
begin
|
59
62
|
Puppet.override(@context_overrides, _("For compiling environment catalog %{env}") % { env: environment.name }) do
|
@@ -337,10 +337,11 @@ class Puppet::Parser::Resource < Puppet::Resource
|
|
337
337
|
end
|
338
338
|
|
339
339
|
def replace_sensitive_data
|
340
|
-
parameters.
|
340
|
+
parameters.keys.each do |name|
|
341
|
+
param = parameters[name]
|
341
342
|
if param.value.is_a?(Puppet::Pops::Types::PSensitiveType::Sensitive)
|
342
343
|
@sensitive_parameters << name
|
343
|
-
|
344
|
+
parameters[name] = Puppet::Parser::Resource::Param.from_param(param, param.value.unwrap)
|
344
345
|
end
|
345
346
|
end
|
346
347
|
end
|
data/lib/puppet/pops/issues.rb
CHANGED
@@ -913,5 +913,10 @@ module Issues
|
|
913
913
|
LOADER_FAILURE = issue :LOADER_FAILURE, :type do
|
914
914
|
_('Failed to load: %{type_name}') % { type: type }
|
915
915
|
end
|
916
|
+
|
917
|
+
DEPRECATED_APP_ORCHESTRATION = issue :DEPRECATED_APP_ORCHESTRATION, :klass do
|
918
|
+
_("Use of the application-orchestration %{expr} is deprecated. See https://puppet.com/docs/puppet/5.5/deprecated_language.html" % { expr: label(klass) })
|
919
|
+
end
|
920
|
+
|
916
921
|
end
|
917
922
|
end
|
@@ -194,6 +194,11 @@ class Checker4_0 < Evaluator::LiteralEvaluator
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
+
def check_Application(o)
|
198
|
+
check_NamedDefinition(o)
|
199
|
+
acceptor.accept(Issues::DEPRECATED_APP_ORCHESTRATION, o, {:klass => o})
|
200
|
+
end
|
201
|
+
|
197
202
|
def check_AssignmentExpression(o)
|
198
203
|
case o.operator
|
199
204
|
when '='
|
@@ -291,6 +296,7 @@ class Checker4_0 < Evaluator::LiteralEvaluator
|
|
291
296
|
end
|
292
297
|
|
293
298
|
def check_CapabilityMapping(o)
|
299
|
+
acceptor.accept(Issues::DEPRECATED_APP_ORCHESTRATION, o, {:klass => o})
|
294
300
|
ok =
|
295
301
|
case o.component
|
296
302
|
when Model::QualifiedReference
|
@@ -850,6 +856,10 @@ class Checker4_0 < Evaluator::LiteralEvaluator
|
|
850
856
|
rvalue(o.matching_expr)
|
851
857
|
end
|
852
858
|
|
859
|
+
def check_SiteDefinition(o)
|
860
|
+
acceptor.accept(Issues::DEPRECATED_APP_ORCHESTRATION, o, {:klass => o})
|
861
|
+
end
|
862
|
+
|
853
863
|
def check_UnaryExpression(o)
|
854
864
|
rvalue(o.expr)
|
855
865
|
end
|
@@ -31,6 +31,7 @@ class ValidatorFactory_4_0 < Factory
|
|
31
31
|
p[Issues::RT_NO_STORECONFIGS] = Puppet[:storeconfigs] ? :ignore : :warning
|
32
32
|
|
33
33
|
p[Issues::FUTURE_RESERVED_WORD] = :deprecation
|
34
|
+
p[Issues::DEPRECATED_APP_ORCHESTRATION] = :deprecation
|
34
35
|
|
35
36
|
p[Issues::DUPLICATE_KEY] = Puppet[:strict] == :off ? :ignore : Puppet[:strict]
|
36
37
|
p[Issues::NAME_WITH_HYPHEN] = :error
|
@@ -12,7 +12,7 @@ require 'puppet/provider/package'
|
|
12
12
|
|
13
13
|
Puppet::Type.type(:package).provide :dnfmodule, :parent => :dnf do
|
14
14
|
|
15
|
-
has_feature :installable, :uninstallable, :versionable, :supports_flavors
|
15
|
+
has_feature :installable, :uninstallable, :versionable, :supports_flavors, :disableable
|
16
16
|
#has_feature :upgradeable
|
17
17
|
# it's not (yet) feasible to make this upgradeable since module streams don't
|
18
18
|
# always have matching version types (i.e. idm has streams DL1 and client,
|
@@ -34,10 +34,10 @@ Puppet::Type.type(:package).provide :dnfmodule, :parent => :dnf do
|
|
34
34
|
|
35
35
|
def self.instances
|
36
36
|
packages = []
|
37
|
-
cmd = "#{command(:dnf)} module list
|
37
|
+
cmd = "#{command(:dnf)} module list -d 0 -e #{error_level}"
|
38
38
|
execute(cmd).each_line do |line|
|
39
39
|
# select only lines with actual packages since DNF clutters the output
|
40
|
-
next unless line =~ /\[[
|
40
|
+
next unless line =~ /\[[eix]\][, ]/
|
41
41
|
line.gsub!(/\[d\]/, '') # we don't care about the default flag
|
42
42
|
|
43
43
|
flavor = if line.include?('[i]')
|
@@ -48,7 +48,11 @@ Puppet::Type.type(:package).provide :dnfmodule, :parent => :dnf do
|
|
48
48
|
|
49
49
|
packages << new(
|
50
50
|
name: line.split[0],
|
51
|
-
ensure: line.
|
51
|
+
ensure: if line.include?('[x]')
|
52
|
+
:disabled
|
53
|
+
else
|
54
|
+
line.split[1]
|
55
|
+
end,
|
52
56
|
flavor: flavor,
|
53
57
|
provider: name
|
54
58
|
)
|
@@ -98,6 +102,18 @@ Puppet::Type.type(:package).provide :dnfmodule, :parent => :dnf do
|
|
98
102
|
end
|
99
103
|
end
|
100
104
|
|
105
|
+
# should only get here when @resource[ensure] is :disabled
|
106
|
+
def insync?(is)
|
107
|
+
if resource[:ensure] == :disabled
|
108
|
+
# in sync only if package is already disabled
|
109
|
+
pkg = self.class.instances.find do |package|
|
110
|
+
@resource[:name] == package.name && package.properties[:ensure] == :disabled
|
111
|
+
end
|
112
|
+
return true if pkg
|
113
|
+
end
|
114
|
+
return false
|
115
|
+
end
|
116
|
+
|
101
117
|
def enable(args = @resource[:name])
|
102
118
|
execute([command(:dnf), 'module', 'enable', '-d', '0', '-e', self.class.error_level, '-y', args])
|
103
119
|
end
|
@@ -107,6 +123,10 @@ Puppet::Type.type(:package).provide :dnfmodule, :parent => :dnf do
|
|
107
123
|
reset # reset module to the default stream
|
108
124
|
end
|
109
125
|
|
126
|
+
def disable(args = @resource[:name])
|
127
|
+
execute([command(:dnf), 'module', 'disable', '-d', '0', '-e', self.class.error_level, '-y', args])
|
128
|
+
end
|
129
|
+
|
110
130
|
def reset
|
111
131
|
execute([command(:dnf), 'module', 'reset', '-d', '0', '-e', self.class.error_level, '-y', @resource[:name]])
|
112
132
|
end
|
@@ -77,7 +77,7 @@ Puppet::Type.type(:package).provide :pip, :parent => ::Puppet::Provider::Package
|
|
77
77
|
command_options << '--all'
|
78
78
|
end
|
79
79
|
|
80
|
-
execpipe [command, command_options] do |process|
|
80
|
+
execpipe [quote(command), command_options] do |process|
|
81
81
|
process.collect do |line|
|
82
82
|
next unless pkg = parse(line)
|
83
83
|
pkg[:command] = command
|
@@ -138,7 +138,7 @@ Puppet::Type.type(:package).provide :pip, :parent => ::Puppet::Provider::Package
|
|
138
138
|
command = resource_or_provider_command
|
139
139
|
self.class.validate_command(command)
|
140
140
|
|
141
|
-
command_and_options = [command, 'install', "#{@resource[:name]}==versionplease"]
|
141
|
+
command_and_options = [self.class.quote(command), 'install', "#{@resource[:name]}==versionplease"]
|
142
142
|
command_and_options << install_options if @resource[:install_options]
|
143
143
|
execpipe command_and_options do |process|
|
144
144
|
process.collect do |line|
|
@@ -162,7 +162,7 @@ Puppet::Type.type(:package).provide :pip, :parent => ::Puppet::Provider::Package
|
|
162
162
|
self.class.validate_command(command)
|
163
163
|
|
164
164
|
Dir.mktmpdir("puppet_pip") do |dir|
|
165
|
-
command_and_options = [command, 'install', "#{@resource[:name]}", '-d', "#{dir}", '-v']
|
165
|
+
command_and_options = [self.class.quote(command), 'install', "#{@resource[:name]}", '-d', "#{dir}", '-v']
|
166
166
|
command_and_options << install_options if @resource[:install_options]
|
167
167
|
execpipe command_and_options do |process|
|
168
168
|
process.collect do |line|
|
@@ -227,6 +227,9 @@ Puppet::Type.type(:package).provide :pip, :parent => ::Puppet::Provider::Package
|
|
227
227
|
join_options(@resource[:install_options])
|
228
228
|
end
|
229
229
|
|
230
|
+
# Quoting is required if the path to the pip command contains spaces.
|
231
|
+
# Required for execpipe() but not execute(), as execute() already does this.
|
232
|
+
|
230
233
|
def self.quote(path)
|
231
234
|
if path.include?(" ")
|
232
235
|
"\"#{path}\""
|
@@ -234,5 +237,4 @@ Puppet::Type.type(:package).provide :pip, :parent => ::Puppet::Provider::Package
|
|
234
237
|
path
|
235
238
|
end
|
236
239
|
end
|
237
|
-
private_class_method :quote
|
238
240
|
end
|
@@ -89,6 +89,7 @@ Puppet::Type.type(:package).provide :zypper, :parent => :rpm, :source => :rpm do
|
|
89
89
|
options = []
|
90
90
|
options << quiet
|
91
91
|
options << '--no-gpg-check' unless inst_opts.delete('--no-gpg-check').nil?
|
92
|
+
options << '--no-gpg-checks' unless inst_opts.delete('--no-gpg-checks').nil?
|
92
93
|
options << :install
|
93
94
|
|
94
95
|
#zypper 0.6.13 (OpenSuSE 10.2) does not support auto agree with licenses
|