Skip to content

Commit dae7924

Browse files
author
Shakeel Mohamed
committed
Fix style issues
1 parent 968c31e commit dae7924

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

splunklib/client.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,15 @@ 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'])
240+
if k not in ['eai:acl', 'eai:attributes'])
241241

242-
if type(content['type']) is type([]):
242+
if isinstance(content['type'], list):
243243
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'
244+
# Unset type if it was only 'text/xml'
245+
if len(content['type']) == 0:
245246
content.pop('type', None)
246-
if len(content['type']) == 1: # Flatten 1 element list
247+
# Flatten 1 element list
248+
if len(content['type']) == 1:
247249
content['type'] = content['type'][0]
248250
else:
249251
content.pop('type', None)
@@ -530,7 +532,7 @@ def restart(self, timeout=None):
530532
# This message will be deleted once the server actually restarts.
531533
self.messages.create(name="restart_required", **msg)
532534
result = self.post("server/control/restart")
533-
if timeout is None:
535+
if timeout is None:
534536
return result
535537
start = datetime.now()
536538
diff = timedelta(seconds=timeout)
@@ -1619,7 +1621,7 @@ def get(self, name="", owner=None, app=None, sharing=None, **query):
16191621
name = UrlEncoded(name, encode_slash=True)
16201622
return super(Collection, self).get(name, owner, app, sharing, **query)
16211623

1622-
1624+
16231625

16241626

16251627
class ConfigurationFile(Collection):
@@ -1799,7 +1801,7 @@ def create(self, password, username, realm=None):
17991801
storage_password = StoragePassword(self.service, self._entity_path(state), state=state, skip_refresh=True)
18001802

18011803
return storage_password
1802-
1804+
18031805
def delete(self, username, realm=None):
18041806
"""Delete a storage password by username and/or realm.
18051807
@@ -1970,7 +1972,7 @@ def clean(self, timeout=60):
19701972
:return: The :class:`Index`.
19711973
"""
19721974
self.refresh()
1973-
1975+
19741976
tds = self['maxTotalDataSizeMB']
19751977
ftp = self['frozenTimePeriodInSecs']
19761978
was_disabled_initially = self.disabled
@@ -1989,7 +1991,7 @@ def clean(self, timeout=60):
19891991
while self.content.totalEventCount != '0' and datetime.now() < start+diff:
19901992
sleep(1)
19911993
self.refresh()
1992-
1994+
19931995
if self.content.totalEventCount != '0':
19941996
raise OperationError, "Cleaning index %s took longer than %s seconds; timing out." %\
19951997
(self.name, timeout)
@@ -2934,7 +2936,7 @@ def export(self, query, **params):
29342936
raise TypeError("Cannot specify an exec_mode to export.")
29352937
params['segmentation'] = params.get('segmentation', 'none')
29362938
return self.post(path_segment="export",
2937-
search=query,
2939+
search=query,
29382940
**params).body
29392941

29402942
def itemmeta(self):
@@ -2997,7 +2999,7 @@ def oneshot(self, query, **params):
29972999
raise TypeError("Cannot specify an exec_mode to oneshot.")
29983000
params['segmentation'] = params.get('segmentation', 'none')
29993001
return self.post(search=query,
3000-
exec_mode="oneshot",
3002+
exec_mode="oneshot",
30013003
**params).body
30023004

30033005

0 commit comments

Comments
 (0)