I have a state like
django.syncdb:
module.run:
- settings_module: mvod.dev_settings
- bin_env: /home/vagrant/virtualenv/
- migrate: True
- require:
- pip: mvod
- mysql_grants: mvod_user_grants
- file: /tmp/mvod.log
The docs aren't very specific about what this exactly does, though it indeed does seem to do what I expect, meaning run the command django-admin.py syncdb --settings=mvod.dev_settings --migrate
from inside the directory /home/vagrant/virtualenv
.
It actually fails to do this, since the /home/vagrant/virtualenv/
path actually needs to set to /home/vagrant/virtualenv/bin/django-admin.py
.
However, i ran this in an environment where django wasn't installed, and so i'd expect this to fail. The state however returned Result: True
but then the output was this Is a directory
I figured out eventually that i have to replace the line bin_env: /home/vagrant/virtualenv/
with bin_env: /home/vagrant/virtualenv/bin/django-admin.py
since that's what i was trying to call.
Bottom line: i would have figured it out much sooner had i had a way of turning the state into the exact command being executed.
So is there a way to do this real fast?