Feel free to brave, if you want. Armed with the idea that cli.py->main() is the entry point from the splunk executable into the python code, most of the rest of it is fairly straightforward python, but a lot of what it's trying to do is quite specific to splunk.
If you've got time to kill and want to debug a bug you're seeing, you can grab the logger we use and coerce it into printf style debugging. Sounds like a waste of time to me, though. In this case I presume that files_to_export is set in a conditional path that was traversed in our testing, but not for you.
Okay, actual fail here is an incorrect exception catch combined with an incorrect exception handling.
Either the glob or the filter tossed an exception (that the migration code hid), and then it didn't handle the lack of a variable correctly. You could edit migration.py:
def suggestExport(bundle, metadata, subdir, type, is_correct_file_type):
base = bundle.location()
try:
candidate_files = glob.glob(os.path.join(base, subdir, '*'))
should be hacked to
def suggestExport(bundle, metadata, subdir, type, is_correct_file_type):
base = bundle.location()
search_dir = os.path.join(base,subdir)
if not os.path.isdir(search_dir):
return False # no objects -> no export needed
try:
candidate_files = glob.glob(os.path.join(search_dir, '*'))
I'm filing the bug.
... View more