Skip to content

Commit

Permalink
Fixing bugs related to running fab
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Proffitt committed Mar 3, 2014
1 parent 8888f4d commit ebfb22d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fabric_bolt/core/views.py
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions fabric_bolt/projects/sockets.py
Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions fabric_bolt/projects/views.py
Expand Up @@ -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)
Expand Down Expand Up @@ -387,17 +387,20 @@ 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:
command.append('--' + get_key_value_string(command_to_config[key], config[key]))

command.append('--fabfile={}'.format(get_fabfile_path(self.object.stage.project)))

print command

return command

def output_stream_generator(self):
Expand Down

0 comments on commit ebfb22d

Please sign in to comment.