Skip to content

Commit

Permalink
Do not traceback on unknown severity value (RhBug:1545075)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha authored and Martin Hatina committed Mar 26, 2018
1 parent 0a22cb3 commit 9382daf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dnf/cli/commands/updateinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ class UpdateInfoCommand(commands.Command):
SECURITY2LABEL = {'Critical': _('Critical/Sec.'),
'Important': _('Important/Sec.'),
'Moderate': _('Moderate/Sec.'),
'Low': _('Low/Sec.'),
None: _('Unknown/Sec.')}
'Low': _('Low/Sec.')}

direct_commands = {'list-updateinfo' : 'list',
'list-security' : 'list',
Expand Down Expand Up @@ -280,8 +279,10 @@ def inst2mark(inst):
return ('' if not mixed else 'i ' if inst else ' ')

def type2label(typ, sev):
return (cls.SECURITY2LABEL[sev] if typ == hawkey.ADVISORY_SECURITY
else cls.TYPE2LABEL[typ])
if typ == hawkey.ADVISORY_SECURITY:
return cls.SECURITY2LABEL.get(sev, _('Unknown/Sec.'))
else:
return cls.TYPE2LABEL.get(typ, _('unknown'))

# Sort IDs and convert types to labels.
nevramark2id2tlbl = OrderedDict(
Expand Down

0 comments on commit 9382daf

Please sign in to comment.