File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
lib/puppet/provider/package
spec/unit/provider/package Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ def install
93
93
# module has no default profile and no profile was requested, so just enable the stream
94
94
# DNF versions prior to 4.2.8 do not need this workaround
95
95
# see https://bugzilla.redhat.com/show_bug.cgi?id=1669527
96
- if @resource [ :flavor ] == nil && e . message =~ /^missing groups or modules: #{ Regexp . quote ( @resource [ :name ] ) } $/
96
+ if @resource [ :flavor ] == nil && e . message =~ /^(?: missing|broken) groups or modules: #{ Regexp . quote ( @resource [ :name ] ) } $/
97
97
enable ( args )
98
98
else
99
99
raise
Original file line number Diff line number Diff line change 123
123
provider . install
124
124
end
125
125
126
- it "should just enable the module if it has no default profile" do
126
+ it "should just enable the module if it has no default profile(missing groups or modules) " do
127
127
dnf_exception = Puppet ::ExecutionFailure . new ( "Error: Problems in request:\n missing groups or modules: #{ resource [ :name ] } " )
128
128
allow ( provider ) . to receive ( :execute ) . with ( array_including ( 'install' ) ) . and_raise ( dnf_exception )
129
129
resource [ :ensure ] = :present
132
132
provider . install
133
133
end
134
134
135
+ it "should just enable the module if it has no default profile(broken groups or modules)" do
136
+ dnf_exception = Puppet ::ExecutionFailure . new ( "Error: Problems in request:\n broken groups or modules: #{ resource [ :name ] } " )
137
+ allow ( provider ) . to receive ( :execute ) . with ( array_including ( 'install' ) ) . and_raise ( dnf_exception )
138
+ resource [ :ensure ] = :present
139
+ expect ( provider ) . to receive ( :execute ) . with ( array_including ( 'install' ) ) . ordered
140
+ expect ( provider ) . to receive ( :execute ) . with ( array_including ( 'enable' ) ) . ordered
141
+ provider . install
142
+ end
143
+
135
144
it "should just enable the module if enable_only = true" do
136
145
resource [ :ensure ] = :present
137
146
resource [ :enable_only ] = true
You can’t perform that action at this time.
0 commit comments