You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
831 B

# Generic utility functions
import os
# originally moved from exec_anaconda.py
# Note: the following functions do NOT work with Search Head
# Pooling/shared storage.
def get_splunkhome_path():
return os.path.normpath(os.environ['SPLUNK_HOME'])
def make_splunkhome_path(p):
return os.path.join(get_splunkhome_path(), *p)
def get_etc_path():
return os.environ.get('SPLUNK_ETC', os.path.join(get_splunkhome_path(), 'etc'))
def get_apps_path(bundle_path=None):
"""
Get the full path to the 'apps' directory.
Args:
bundle_path: path of the search bundle that contains the 'apps' directory
Returns:
path to the apps directory
"""
full_path_to_apps_dir = bundle_path if bundle_path else get_etc_path()
return os.path.normpath(os.path.join(full_path_to_apps_dir, 'apps'))