Commits

Mikhail Korobov committed 5ec1642

Some defaults for env.conf parameters

  • Participants
  • Parent commits 419603e

Comments (0)

Files changed (1)

File fab_deploy/utils.py

     HOME_DIR = '/home/%s' % env.user
     ENV_BASE, SRC_BASE = 'envs', 'src'
 
-    env.conf.update({
-       'HOME_DIR': HOME_DIR,
-       'ENV_BASE': ENV_BASE,
-       'SRC_BASE': SRC_BASE,
-       'ENV_DIR': HOME_DIR + '/' + ENV_BASE + '/' + env.conf['INSTANCE_NAME'],
-       'SRC_DIR': HOME_DIR + '/' + SRC_BASE + '/' + env.conf['INSTANCE_NAME'],
-    })
+    if 'INSTANCE_NAME' not in env.conf:
+        env.conf['INSTANCE_NAME'] = env.user
+
+    if 'SERVER_NAME' not in env.conf:
+        env.conf['SERVER_NAME'] = env.hosts[0]
+
+    defaults = dict(
+        HG_BRANCH = 'default',
+        DB_NAME = env.conf['INSTANCE_NAME'],
+        PROCESSES = 1,
+        THREADS = 5,
+        HOME_DIR = HOME_DIR,
+        ENV_BASE = ENV_BASE,
+        SRC_BASE = SRC_BASE,
+        ENV_DIR = HOME_DIR + '/' + ENV_BASE + '/' + env.conf['INSTANCE_NAME'],
+        SRC_DIR = HOME_DIR + '/' + SRC_BASE + '/' + env.conf['INSTANCE_NAME'],
+    )
+    defaults.update(env.conf)
+    env.conf = defaults