mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Catch TypeError thrown by m2crypto when parsing missing subjects in certificate files.
This commit is contained in:
parent
a88386ad44
commit
3e3f7f5d8e
1 changed files with 8 additions and 4 deletions
|
@ -330,10 +330,14 @@ def _parse_subject(subject):
|
|||
for nid_name, nid_num in six.iteritems(subject.nid):
|
||||
if nid_num in nids:
|
||||
continue
|
||||
val = getattr(subject, nid_name)
|
||||
if val:
|
||||
ret[nid_name] = val
|
||||
nids.append(nid_num)
|
||||
try:
|
||||
val = getattr(subject, nid_name)
|
||||
if val:
|
||||
ret[nid_name] = val
|
||||
nids.append(nid_num)
|
||||
except TypeError as e:
|
||||
if e.args and e.args[0] == 'No string argument provided':
|
||||
pass
|
||||
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue