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
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...