Skip to content

Commit 949db5e

Browse files
committed
fix<ALT>: fixed fault exception when no provider as user/group was defined
! fixed fault exception when no provider as user/group was defined closes ALT bug https://bugzilla.altlinux.org/54857
1 parent e227c27 commit 949db5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/puppet/type/group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def delimiter
232232
# @return [Boolean] if the group exists on the system
233233
# @api private
234234
def exists?
235-
provider.exists?
235+
provider&.exists?
236236
end
237237
end
238238
end

lib/puppet/type/user.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module Puppet
9191
end
9292

9393
def retrieve
94-
if provider.exists?
94+
if provider&.exists?
9595
if provider.respond_to?(:is_role?) and provider.is_role?
9696
:role
9797
else
@@ -511,7 +511,7 @@ def insync?(current)
511511
# @return [Boolean] if the user exists on the system
512512
# @api private
513513
def exists?
514-
provider.exists?
514+
provider&.exists?
515515
end
516516

517517
newproperty(:roles, :parent => Puppet::Property::List, :required_features => :manages_roles) do

0 commit comments

Comments
 (0)