1. Mikhail Korobov
  2. django-fab-deploy


Mikhail Korobov  committed 57c57e7

Deprecate DB_USER default value ('root')

  • Participants
  • Parent commits 91e8ffd
  • Branches default

Comments (0)

Files changed (3)

File docs/CHANGES.rst

View file
  • Ignore whitespace
 - remote django management command errors are no longer silinced;
 - invoking ``create_linux_account`` with non-default username is fixed;
 - ``define_host`` decorator for easier host definition;
+- default ``DB_USER`` value ('root') is deprecated;
 - default nginx config uses ``INSTANCE_NAME`` for logs.
+In order to upgrade please set ``DB_USER`` to 'root' explicitly in
+``env.conf`` if it was omitted.
 0.7.1 (2011-04-21)

File docs/guide.rst

View file
  • Ignore whitespace
         def my_site():
             env.hosts = ['my_site@example.com']
             env.conf = dict(
+                DB_USER = 'my_site',
                 DB_PASSWORD = 'password',
                 # uncomment this line if the project is not stored in VCS
    .. note::
-       There are some defaults, e.g. :attr:`DB_USER <env.conf.DB_USER>`
-       is 'root' by default, :attr:`DB_NAME <env.conf.DB_NAME>`
+       There are some defaults, e.g. :attr:`DB_NAME <env.conf.DB_NAME>`
        equals to :attr:`INSTANCE_NAME <env.conf.INSTANCE_NAME>`,
        and :attr:`INSTANCE_NAME <env.conf.INSTANCE_NAME>` equals
        to username obtained from :attr:`env.hosts`.
    including other requirement files using "-r" syntax.
    There is also
+   ::
        django-fab-deploy generate_reqs

File fab_deploy/utils.py

View file
  • Ignore whitespace
+Default DB_USER value ('root') is deprecated. This default value will be
+removed in 0.8 release. The default value for DB_USER will be reintroduced
+again in 0.9 release (it will be env.conf.INSTANCE_NAME).
+Please set DB_USER to 'root' explicitly in order to remove this warning.
 def _codename(distname, version, id):
     patterns = [
         ('lenny', ('debian', '^5', '')),
         def my_site():
             env.hosts = ['my_site@example.com']
             env.conf = dict(
+                DB_USER = 'my_site',
                 DB_PASSWORD = 'password',
     env.conf.setdefault('INSTANCE_NAME', user)
     env.conf.setdefault('PROJECT_PATH', '')
+    if 'DB_USER' not in env.conf:
+        warn(DB_USER_WARNING)
     HOME_DIR = '/home/%s' % user if user != 'root' else '/root'
     SRC_DIR = posixpath.join(HOME_DIR, 'src', env.conf['INSTANCE_NAME'])
     PROJECT_DIR = posixpath.join(SRC_DIR, env.conf['PROJECT_PATH']).rstrip('/')