Commits

ghorvath committed 3fc87f8

tags fixtures. fabfile updateindex createsuper. fab fix missing config bug see https://github.com/fabric/fabric/issues/587

Comments (0)

Files changed (2)

 from fabric.utils import error
 from contextlib import contextmanager as _contextmanager
 from sys import executable as sys_executable
+import os
 from json import load as json_load
 from functools import partial
 
 class CustomTask(WrappedCallableTask):
     def __init__(self, callable, *args, **kwargs):
         super(CustomTask, self).__init__(callable, *args, **kwargs)
-        env.use_ssh_config = True
+        if env.ssh_config_path and os.path.isfile(os.path.expanduser(env.ssh_config_path)):
+            env.use_ssh_config = True
         if env.host_string == 'localhost' or not env.hosts:
             env.pyexecutable = sys_executable
             env.cd = partial(custom_cd, lcd, 002)
 @task(task_class=CustomTask)
 def collectstatic():
     manage_django('collectstatic --noinput')
+
+@task(task_class=CustomTask)
+def createsuperuser():
+    manage_django('createsuperuser')
+
+@task(task_class=CustomTask)
+def updateindex():
+    "updates the haystack search index"
+    manage_django('update_index')
+
+

freieit/fixtures/initial_data.json

-[{"pk": 1, "model": "freieit.tag", "fields": {"name": "Internet", "parent": []}}, {"pk": 2, "model": "freieit.tag", "fields": {"name": "Office", "parent": []}}, {"pk": 3, "model": "freieit.tag", "fields": {"name": "Multimedia", "parent": []}}, {"pk": 4, "model": "freieit.tag", "fields": {"name": "Server", "parent": []}}, {"pk": 5, "model": "freieit.tag", "fields": {"name": "Programmierung", "parent": []}}, {"pk": 6, "model": "freieit.tag", "fields": {"name": "Betriebssysteme", "parent": []}}, {"pk": 7, "model": "freieit.tag", "fields": {"name": "Privatkunden", "parent": []}}, {"pk": 8, "model": "freieit.tag", "fields": {"name": "Firmenkunden", "parent": []}}]
+[{"pk": 1, "model": "freieit.tag", "fields": {"name": "Internet", "parent": []}}, {"pk": 2, "model": "freieit.tag", "fields": {"name": "Office", "parent": []}}, {"pk": 3, "model": "freieit.tag", "fields": {"name": "Multimedia", "parent": []}}, {"pk": 4, "model": "freieit.tag", "fields": {"name": "Server", "parent": []}}, {"pk": 5, "model": "freieit.tag", "fields": {"name": "Programmierung", "parent": []}}, {"pk": 6, "model": "freieit.tag", "fields": {"name": "Betriebssysteme", "parent": []}}]