Fix AttributeError when running lemur CLI without config#5401
Merged
jmcrawford45 merged 2 commits intoNetflix:mainfrom Apr 8, 2026
Merged
Fix AttributeError when running lemur CLI without config#5401jmcrawford45 merged 2 commits intoNetflix:mainfrom
jmcrawford45 merged 2 commits intoNetflix:mainfrom
Conversation
getattr(script_info, 'config') raises AttributeError when the script_info object doesn't have a config attribute set yet (e.g. when running 'lemur --help' or 'lemur' without a subcommand). Use getattr with a default of None to handle this gracefully. Closes Netflix#4764 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jmcrawford45
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getattr(script_info, 'config')infactory.pyto use a default value ofNone, preventingAttributeErrorwhen runninglemur --helporlemurwithout a subcommandWhen
create_appis called during--helpprocessing, thescript_infoobject may not yet have theconfigattribute set (it's set by theclicallback inmanage.py). Without a default,getattrraisesAttributeError.This addresses the first problem reported in #4764. The other problems mentioned (missing
@with_appcontexton custom plugin CLI commands, and missing@cli.command()onrotate) appear to have been resolved in subsequent commits —rotateis correctly registered and visible inlemur certificate --help.Closes #4764
Test plan
lemur --helpruns successfully and shows all commandslemur certificate --helpshowsrotateand all other subcommandsAttributeErrorwhenscript_infolacks theconfigattribute🤖 Generated with Claude Code