Add BSD fallback for syspaths.CONFIG_DIR

In the absence of _syspaths.py, make sure that the BSDs still look for
configuration files in /usr/local/etc/salt.
This commit is contained in:
Erik Johnson 2014-03-07 14:00:58 -06:00
parent 0b19979366
commit 56c1c2cc75

View File

@ -40,12 +40,16 @@ try:
)
except ImportError:
# The installation time was not generated, let's define the default values
if sys.platform.startswith('win'):
platform = sys.platform.lower()
if platform.startswith('win'):
ROOT_DIR = r'c:\salt' or '/'
CONFIG_DIR = os.path.join(ROOT_DIR, 'conf')
else:
ROOT_DIR = '/'
CONFIG_DIR = os.path.join(ROOT_DIR, 'etc', 'salt')
if 'bsd' in platform:
CONFIG_DIR = os.path.join(ROOT_DIR, 'usr', 'local', 'etc', 'salt')
else:
CONFIG_DIR = os.path.join(ROOT_DIR, 'etc', 'salt')
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')