Skip to content

Commit e5f8d4b

Browse files
author
Shakeel Mohamed
committed
Fix the conf.py example, maintaining fix for #92
1 parent e6fa192 commit e5f8d4b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

splunklib/client.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,17 @@ def _parse_atom_entry(entry):
239239
content = record((k, v) for k, v in content.iteritems()
240240
if k not in ['eai:acl', 'eai:attributes'])
241241

242-
if isinstance(content['type'], list):
243-
content['type'] = [t for t in content['type'] if t != 'text/xml']
244-
# Unset type if it was only 'text/xml'
245-
if len(content['type']) == 0:
242+
if 'type' in content:
243+
if isinstance(content['type'], list):
244+
content['type'] = [t for t in content['type'] if t != 'text/xml']
245+
# Unset type if it was only 'text/xml'
246+
if len(content['type']) == 0:
247+
content.pop('type', None)
248+
# Flatten 1 element list
249+
if len(content['type']) == 1:
250+
content['type'] = content['type'][0]
251+
else:
246252
content.pop('type', None)
247-
# Flatten 1 element list
248-
if len(content['type']) == 1:
249-
content['type'] = content['type'][0]
250-
else:
251-
content.pop('type', None)
252253

253254
return record({
254255
'title': title,

0 commit comments

Comments
 (0)