salt/pkg/smartos/esky/_syspaths.py
Nahum Shalman 3c179c2a41 SmartOS esky packaging: minor fixup
Don't assume that the top directory is named "salt"
The user might choose to name it "salt-<version>"
or "saltstack" or whatever else.

install.sh is already that flexible; this fixes _syspaths.py
2014-01-24 09:47:37 -05:00

23 lines
841 B
Python

import os
import sys
# http://stackoverflow.com/a/404750
# determine if application is a script file or frozen exe
if getattr(sys, 'frozen', False):
application_path = os.path.dirname(sys.executable)
elif __file__:
application_path = os.path.dirname(__file__)
ROOT_DIR=application_path.split("bin/appdata")[0]
# Copied from syspaths.py
CONFIG_DIR = os.path.join(ROOT_DIR, 'etc')
CACHE_DIR = os.path.join(ROOT_DIR, 'var', 'cache', 'salt')
SOCK_DIR = os.path.join(ROOT_DIR, 'var', 'run', 'salt')
SRV_ROOT_DIR = os.path.join(ROOT_DIR, 'srv')
BASE_FILE_ROOTS_DIR = os.path.join(SRV_ROOT_DIR, 'salt')
BASE_PILLAR_ROOTS_DIR = os.path.join(SRV_ROOT_DIR, 'pillar')
BASE_MASTER_ROOTS_DIR = os.path.join(SRV_ROOT_DIR, 'salt-master')
LOGS_DIR = os.path.join(ROOT_DIR, 'var', 'log', 'salt')
PIDFILE_DIR = os.path.join(ROOT_DIR, 'var', 'run')