Commits

Mikhail Korobov committed 24a0c75

fab_deploy.utils.print_env command

  • Participants
  • Parent commits 526fe44

Comments (0)

Files changed (2)

File fab_deploy/__init__.py

 from fab_deploy.deploy import *
 from fab_deploy.virtualenv import pip, pip_install, pip_update
 from fab_deploy.django_commands import migrate, manage, syncdb, compress, test, coverage
-from fab_deploy.utils import run_as, update_env, inside_project, inside_virtualenv, delete_pyc
+from fab_deploy.utils import run_as, update_env, inside_project, inside_virtualenv, delete_pyc, print_env
 from fab_deploy.system import create_linux_account, ssh_add_key
 from fab_deploy.crontab import crontab_set, crontab_add, crontab_show, crontab_remove, crontab_update
 from fab_deploy.mysql import mysql_execute, mysql_install, mysql_create_db, mysqldump

File fab_deploy/utils.py

 import os
+import pprint
 from functools import wraps
-from fabric.context_managers import prefix, cd
 from fabric.contrib.files import upload_template
-from fabric.api import env, run
+from fabric.api import *
 from fabric.state import _AttributeDict
 
 def run_as(user):
     """ Deletes *.pyc files from project source dir """
     run("find . -name '*.pyc' -delete")
 
+def print_env():
+    """ Prints env values. Useful for debugging. """
+    puts(pprint.pformat(env))
+
 def _data_path(fname):
     """Return the path to a data file of ours."""
     return os.path.join(os.path.split(__file__)[0], fname)