All Apps and Add-ons

Feature Request: AppInspect to check for absolute paths

gsopkoTC
Path Finder

All one has to do is search Splunk Answers as such...

https://answers.splunk.com/search.html?f=&redirect=search%2Fsearch&sort=relevance&q=ImportError%3A+N...

...to see that there are a lot of apps finding conflicting Python libraries/modules. A cause for this is that most apps that I have seen that I have encountered this issue have not specified an absolute path as suggested via Splunk SDK documentation, as well as what's provided in the example init py here (line 17):

https://github.com/splunk/splunk-sdk-python/blob/master/splunklib/__init__.py#L17

A step that would mitigate this would be for the AppInspect program to look for this:

from future import absolute_import

And if not, reject the app with a statement regarding that the app needs to be built to utilize absolute versus relative paths. Otherwise, we'll all continue to have the problem of apps stumbling into another app directory looking for a Python library and throwing an error. Other steps should also be taken to prevent, but this is a good start and can be readily automated.

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!