From ebfb22db3b840cb84c5ac51f7a43198ba835c7fa Mon Sep 17 00:00:00 2001 From: Jared Proffitt Date: Mon, 3 Mar 2014 15:45:28 -0500 Subject: [PATCH] Fixing bugs related to running fab --- fabric_bolt/core/views.py | 2 +- fabric_bolt/projects/sockets.py | 5 +++-- fabric_bolt/projects/views.py | 9 ++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fabric_bolt/core/views.py b/fabric_bolt/core/views.py index 6cd949d..b5da89e 100644 --- a/fabric_bolt/core/views.py +++ b/fabric_bolt/core/views.py @@ -40,7 +40,7 @@ def get_context_data(self, **kwargs): if len(deploys) == 0: return context - projects = list(Project.objects.all()) + projects = list(Project.active_records.all()) if len(projects) == 0: return context diff --git a/fabric_bolt/projects/sockets.py b/fabric_bolt/projects/sockets.py index 26d5fa0..49c626a 100644 --- a/fabric_bolt/projects/sockets.py +++ b/fabric_bolt/projects/sockets.py @@ -72,10 +72,11 @@ def get_key_value_string(key, value): elif isinstance(value, float): return key + '=' + str(value) else: - return '{}="{}"'.format(key, value.replace('"', '\\"')) + return '{}={}'.format(key, value.replace('"', '\\"')) if normal_options: - command.append('--set ' + ','.join(get_key_value_string(key, config[key]) for key in normal_options)) + command.append('--set') + command.append(','.join(get_key_value_string(key, config[key]) for key in normal_options)) if special_options: for key in special_options: diff --git a/fabric_bolt/projects/views.py b/fabric_bolt/projects/views.py index ef6bbc1..23f30df 100644 --- a/fabric_bolt/projects/views.py +++ b/fabric_bolt/projects/views.py @@ -130,7 +130,7 @@ class ProjectDetail(DetailView): model = models.Project def dispatch(self, request, *args, **kwargs): - if request.user.user_is_historian: + if request.user.user_is_historian(): self.template_name = "projects/historian_detail.html" return super(ProjectDetail, self).dispatch(request, *args, **kwargs) @@ -387,10 +387,11 @@ def get_key_value_string(key, value): elif isinstance(value, float): return key + '=' + str(value) else: - return '{}="{}"'.format(key, value.replace('"', '\\"')) + return '{}={}'.format(key, value.replace('"', '\\"')) if normal_options: - command.append('--set ' + ','.join(get_key_value_string(key, config[key]) for key in normal_options)) + command.append('--set') + command.append(','.join(get_key_value_string(key, config[key]) for key in normal_options)) if special_options: for key in special_options: @@ -398,6 +399,8 @@ def get_key_value_string(key, value): command.append('--fabfile={}'.format(get_fabfile_path(self.object.stage.project))) + print command + return command def output_stream_generator(self):