File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,16 @@ def _parse_atom_entry(entry):
237237
238238 # Filter some of the noise out of the content record
239239 content = record ((k , v ) for k , v in content .iteritems ()
240- if k not in ['eai:acl' , 'eai:attributes' , 'type' ])
240+ if k not in ['eai:acl' , 'eai:attributes' ])
241+
242+ if type (content ['type' ]) is type ([]):
243+ content ['type' ] = [t for t in content ['type' ] if t != 'text/xml' ]
244+ if len (content ['type' ]) == 0 : # Unset type if it was only 'text/xml'
245+ content .pop ('type' , None )
246+ if len (content ['type' ]) == 1 : # Flatten 1 element list
247+ content ['type' ] = content ['type' ][0 ]
248+ else :
249+ content .pop ('type' , None )
241250
242251 return record ({
243252 'title' : title ,
Original file line number Diff line number Diff line change @@ -103,6 +103,20 @@ def test_restart(self):
103103 self .service .restart (timeout = 120 )
104104 service .login () # Make sure we are awake
105105
106+ def test_read_outputs_with_type (self ):
107+ name = testlib .tmpname ()
108+ service = client .connect (** self .opts .kwargs )
109+ service .post ('data/outputs/tcp/syslog' , name = name , type = 'tcp' )
110+ entity = client .Entity (service , 'data/outputs/tcp/syslog/' + name )
111+ self .assertTrue ('tcp' , entity .content .type )
112+
113+ if service .restart_required :
114+ self .restartSplunk ()
115+ service = client .connect (** self .opts .kwargs )
116+ client .Entity (service , 'data/outputs/tcp/syslog/' + name ).delete ()
117+ if service .restart_required :
118+ self .restartSplunk ()
119+
106120 def test_splunk_version (self ):
107121 service = client .connect (** self .opts .kwargs )
108122 v = service .splunk_version
You can’t perform that action at this time.
0 commit comments