Skip to content

Commit

Permalink
Merge pull request #1374 from justinstoller/metadata_loading_robustness
Browse files Browse the repository at this point in the history
(PE-34196, PE-34917) Make loading metadata in `--incremental` deploys more robust
  • Loading branch information
justinstoller authored Mar 20, 2024
2 parents d623be1 + 78ff934 commit e5be03b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CHANGELOG

Unreleased
----------
- Make metadata loading during incremental deploys more robust [PE-34917](https://perforce.atlassian.net/browse/PE-34917)


3.16.0
Expand Down
5 changes: 4 additions & 1 deletion lib/r10k/module_loader/puppetfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ def load_metadata!
@existing_module_versions_by_name = @existing_module_metadata.map {|mod| [ mod.name, mod.version ] }.to_h
empty_load_output.merge(modules: @existing_module_metadata)

rescue SyntaxError, LoadError, ArgumentError, NameError => e
rescue ScriptError, StandardError => e
logger.warn _("Unable to preload Puppetfile because of %{msg}" % { msg: e.message })

@existing_module_metadata = []
@existing_module_versions_by_name = {}
end

def add_module_metadata(name, info)
Expand Down

0 comments on commit e5be03b

Please sign in to comment.