"""
Management command to execute several deployment steps with a single command.
More to save flux in the puppet manifest than any effort to reduce typing
required.

.. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au>

"""
import logging
import types

from django.core.management.base import NoArgsCommand
from django.core import management
from django.conf import settings

LOGGER = logging.getLogger(__name__)


class Command(NoArgsCommand):
    """
    This command is a simple aggregate command to allow us (the devs) to
    easily add deployment steps to our release process e.g. to add a JS minify
    step without needing to add steps to the puppet release manfiest.

    See http://redmine.office.infoxchange.net.au/issues/7854
    """
    def handle_noargs(self, **options):
        try:
            deploy_cmds = settings.IX_DEPLOY_CMDS
        except AttributeError:
            deploy_cmds = None

        # Wrap in a tuple if we were only given one command.
        if isinstance(deploy_cmds, types.StringTypes):
            deploy_cmds = (deploy_cmds,)

        if deploy_cmds:
            for cmd in deploy_cmds:
                # interactive=False is the same as --noinput.
                args = {}
                if type(cmd) is tuple:
                    (cmd, args) = cmd
                management.call_command(cmd, interactive=False, **args)

@@ -1238,12 +1238,40 @@
 gs =
+ %5B%5D%0A                kwargs =
  %7B%7D%0A
-
     
@@ -1305,16 +1305,58 @@
  tuple:%0A
+                    if len(cmd) == 3:%0A    
         
@@ -1381,16 +1381,24 @@
 args
+, kwargs
 ) = cmd%0A
     
@@ -1393,16 +1393,140 @@
 ) = cmd%0A
+                    else:%0A                        (cmd, args) = cmd%0A                kwargs.setdefault('interactive', False)%0A
         
@@ -1566,29 +1566,19 @@
 md, 
-interactive=False
+*args
 , **
+kw
 args

Allow specifying both args and kwargs in deploy