M djeploy/__init__.py +4 -0
@@ 81,6 81,7 @@ class DeployConfig(object):
def __init__(self, config_file='fabconfig.json'):
self.config_file = config_file
+ self._space = None
self.load_config()
self._global_vars()
@@ 125,3 126,6 @@ class DeployConfig(object):
if key_data and hasattr(self, 'load_{0}'.format(key)):
func = getattr(self, 'load_{0}'.format(key))
func(key_data)
+
+ # Set config object space
+ self.load_global({'_space': space})
M djeploy/deploy.py +5 -1
@@ 22,7 22,11 @@ def get_releases_list(release_dir=None):
if command.is_local:
opts['capture'] = True
releases = command.run('ls -xt', **opts)
- releases = [x.replace('/', '') for x in releases.split()]
+ if isinstance(releases, dict):
+ for k, v in releases.iteritems():
+ releases[k] = [x.replace('/', '') for x in v.split()]
+ else:
+ releases = [x.replace('/', '') for x in releases.split()]
return sorted(releases)
M djeploy/globals.py +4 -3
@@ 1,4 1,5 @@
import os
+from fabric.tasks import execute
from fabric.colors import red as _red
from fabric.contrib.files import exists as fab_exists
from fabric.api import *
@@ 97,7 98,7 @@ class Command(object):
tmp_fab_settings.update(fab_settings)
if 'clear_after_run' in tmp_fab_settings:
self._clear_settings = tmp_fab_settings.pop('clear_after_run')
-
+
return tmp_fab_settings
def get_settings(self, fab_settings):
@@ 130,9 131,9 @@ class Command(object):
if fab_settings:
a, k = self.get_settings(fab_settings)
with settings(*a, **k):
- output = cmd(*args, **kwargs)
+ output = execute(cmd, *args, **kwargs)
else:
- output = cmd(*args, **kwargs)
+ output = execute(cmd, *args, **kwargs)
if self._clear_settings:
self.clear_local_settings()