diff options
author | Patrick Michaud <vegitron@gmail.com> | 2013-10-18 17:26:10 -0700 |
---|---|---|
committer | Patrick Michaud <vegitron@gmail.com> | 2013-10-18 17:26:10 -0700 |
commit | c936bc67bbc0a799ded95f0d7817280c6712e96b (patch) | |
tree | 28df7f6aa6e11ca061908f0879e59105607ba9b2 /web_infrastructure | |
parent | 251b52bef8f3639804948de5c2faefe92cf44369 (diff) | |
download | ansible-modules-core-c936bc67bbc0a799ded95f0d7817280c6712e96b.tar.gz |
Allow generic django_management commands
This commit removes the restriction on django management commands. If a command is unknown to the django installation, there will be a concise error produced.
for example:
tasks:
- name: invalid command
django_manage: virtualenv="/valid/virtualenv" app_path="/valid/app_path" command="nowaydude"
Results in:
failed: [hostname] => {"cmd": "python manage.py nowaydude", "failed": true}
msg: stdout: Unknown command: 'nowaydude'
Type 'manage.py help' for usage.
:stderr: Unknown django command: nowaydude
Diffstat (limited to 'web_infrastructure')
-rw-r--r-- | web_infrastructure/django_manage | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/web_infrastructure/django_manage b/web_infrastructure/django_manage index ec28845d..fd610fb9 100644 --- a/web_infrastructure/django_manage +++ b/web_infrastructure/django_manage @@ -192,7 +192,7 @@ def main(): module = AnsibleModule( argument_spec=dict( - command = dict(default=None, required=True, choices=command_allowed_param_map.keys()), + command = dict(default=None, required=True), app_path = dict(default=None, required=True), settings = dict(default=None, required=False), pythonpath = dict(default=None, required=False, aliases=['python_path']), @@ -254,6 +254,8 @@ def main(): if command == 'createcachetable' and 'table' in err and 'already exists' in err: out = 'Already exists.' else: + if "Unknown command:" in err: + _fail(module, cmd, err, "Unknown django command: %s" % command) _fail(module, cmd, out, err, path=os.environ["PATH"], syspath=sys.path) changed = False |