1. Brent Tubbs
  2. silk-config

Commits

Brent Tubbs  committed bd6fbf2

adding SILK_START env var

  • Participants
  • Parent commits 7cb3534
  • Branches default

Comments (0)

Files changed (3)

File app_container/__init__.py

View file
 from lib import *
 
 # set up config dictionary
-root = os.environ.get('SILK_ROOT', get_site_root(os.getcwd()))
+start = os.environ.get('SILK_START', os.getcwd())
+root = get_site_root(start)
 _site_config = get_config(root, get_role())
 if 'app_config' in _site_config:
     config = _site_config['app_config']

File app_container/lib.py

View file
         #return None if no role there either
         return os.environ.get('SILK_ROLE', None)
 
-def get_role_config(role):
+def get_role_config(role, root=None):
     if role:
-        role_file = '%s/roles/%s.yaml' % (get_site_root(os.getcwd()), role)
+        start = os.environ.get('SILK_START', os.getcwd())
+        root = root or get_site_root(start)
+        role_file = '%s/roles/%s.yaml' % (root, role)
         config =  yaml.safe_load(open(role_file, 'r').read())
         return config
 

File setup.py

View file
 
 setup(
     name='silk-config',
-    version='0.3.4',
+    version='0.3.5',
     author='Brent Tubbs',
     author_email='brent.tubbs@gmail.com',
 	packages=find_packages(),