Commits

Mikhail Korobov committed 57c57e7

Deprecate DB_USER default value ('root')

Comments (0)

Files changed (3)

 - 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)
 ------------------
 
         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
 

fab_deploy/utils.py

 https://bitbucket.org/kmike/django-fab-deploy/issues/new
 """
 
+DB_USER_WARNING = """
+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',
             )
             update_env()
     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('/')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.