1. Mikhail Korobov
  2. django-fab-deploy
  3. Issues
Issue #25 resolved

django_commands.command_is_available should fail loudly if ./manage.py fails with exception because of configuration error

Mikhail Korobov
repo owner created an issue

No description provided.

Comments (3)

  1. Mikhail Korobov reporter

    The implementaiton seems to be broken (tests are failing), e.g. this:

    ./runtests.py Ubuntu-10.10 DeployTest

    produces this error (while the error should be only a warning because there is no error, migrate command is just unavailable):

    ...(snip)
    [foo@127.0.0.1:2222] run: python manage.py migrate --noinput 
    [foo@127.0.0.1:2222] out: Unknown command: 'migrate'
    [foo@127.0.0.1:2222] out: Type 'manage.py help' for usage.
    [foo@127.0.0.1:2222] out: 
    
    Fatal error: run() encountered an error (return code 1) while executing 'python manage.py migrate --noinput '
    
    Aborting.
    Traceback (most recent call last):
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabtest/utils.py", line 21, in fab
        res = command(*args, **kwargs)
      File "/Users/kmike/svn/django-fab-deploy/fab_deploy/deploy.py", line 40, in deploy_project
        dj_cmd.migrate()
      File "/Users/kmike/svn/django-fab-deploy/fab_deploy/django_commands.py", line 51, in migrate
        manage('migrate --noinput %s' % params)
      File "/Users/kmike/svn/django-fab-deploy/fab_deploy/utils.py", line 234, in inner
        return func(*args, **kwargs)
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/contextlib.py", line 34, in __exit__
        self.gen.throw(type, value, traceback)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabric/context_managers.py", line 93, in _setenv
        yield
      File "/Users/kmike/svn/django-fab-deploy/fab_deploy/utils.py", line 234, in inner
        return func(*args, **kwargs)
      File "/Users/kmike/svn/django-fab-deploy/fab_deploy/django_commands.py", line 41, in manage
        run('python manage.py ' + command)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabric/network.py", line 303, in host_prompting_wrapper
        return func(*args, **kwargs)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabric/operations.py", line 918, in run
        return _run_command(command, shell, pty, combine_stderr)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabric/operations.py", line 853, in _run_command
        _handle_failure(message=msg)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabric/operations.py", line 85, in _handle_failure
        return func(message)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabric/utils.py", line 24, in abort
        sys.exit(1)
    SystemExit: 1
    E$ VBoxManage controlvm Ubuntu-10.10 poweroff
    
    ======================================================================
    ERROR: test_deploy (fab_deploy_tests.tests.deploy.DeployTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/kmike/svn/django-fab-deploy/fab_deploy_tests/tests/deploy.py", line 108, in test_deploy
        fab(deploy_project)
      File "/Users/kmike/envs/planor/lib/python2.6/site-packages/fabtest/utils.py", line 27, in fab
        raise FabricAbortException()
    FabricAbortException
    
    ----------------------------------------------------------------------
    
    

    but it's a deep night here and I'm not sure why is the implementation incorrect ;) So I just rewrote it and added tests

  2. Log in to comment