Skip to content

Commit 52655bb

Browse files
committed
(bug) Return nil when GitHub and GitLab queries return non-200 code
This fixes a bug in the `GitHub` and `GitLab` spec searchers that prevented the spec searcher from using the `GitLab` and `GClone` spec searchers. Previously, if either spec searcher returned a non-200 response code, they would return an empty string. This prevented the `Git` spec searcher from using any other spec searcher other than `GitHub` to retrieve module metadata.
1 parent fea5d15 commit 52655bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/puppetfile-resolver/spec_searchers/git/github.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def self.metadata(puppetfile_module, resolver_ui, config)
4343

4444
if response.code != '200'
4545
resolver_ui.debug(err_msg + "Expected HTTP Code 200, but received #{response.code}")
46-
return ''
46+
return nil
4747
end
4848
response.body
4949
end

lib/puppetfile-resolver/spec_searchers/git/gitlab.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def self.metadata(puppetfile_module, resolver_ui, config)
4545

4646
if response.code != '200'
4747
resolver_ui.debug(err_msg + "Expected HTTP Code 200, but received #{response.code}")
48-
return ''
48+
return nil
4949
end
5050
response.body
5151
end

0 commit comments

Comments
 (0)