Skip to content

Commit 9550734

Browse files
author
David Noble
committed
Quick fix for Search Commands demo for Guido tomorrow
1 parent 74eb664 commit 9550734

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# [commands.conf]($SPLUNK_HOME/etc/system/README/commands.conf.spec)
22
[defaults]
3-
supports_getinfo = true
43

54
[countmatches]
65
filename = countmatches.py
6+
supports_getinfo = true
77

88
[simulate]
99
filename = simulate.py
10+
supports_getinfo = true
1011

1112
[sum]
1213
filename = sum.py
14+
supports_getinfo = true

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,14 @@ def run(self):
145145
arc_app_lib_dir = os.path.join(arc_app_dir, 'bin', 'splunklib', 'searchcommands')
146146

147147
def exclude(path):
148+
# TODO: Replace with filter function because exclude is deprecated
148149
basename = os.path.basename(path)
149150
for pattern in ['.DS_Store', '.idea', '*.log', '*.py[co]']:
150151
if fnmatch(basename, pattern):
151-
return False
152-
return True
152+
return True
153+
return False
153154

154-
with tarfile.open(tarball, "w") as spl:
155+
with closing(tarfile.open(tarball, "w")) as spl:
155156
spl.add(app_dir, arcname=arc_app_dir, exclude=exclude)
156157
spl.add(lib_dir, arcname=arc_app_lib_dir, exclude=exclude)
157158

splunklib/searchcommands/search_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def process(self, args=argv, input_file=stdin, output_file=stdout):
190190
'filename = %s' %
191191
(type(self).name, path.basename(argv[0])))
192192
self.messages.append('error_message', message)
193-
self.messages.write()
193+
self.messages.write(output_file)
194194
self.logger.error(message)
195195

196196
@staticmethod

0 commit comments

Comments
 (0)