From fb0f0388dee8c7cd612beaa065be8afd06fb2540 Mon Sep 17 00:00:00 2001 From: François Charlier Date: Fri, 2 Dec 2011 16:55:21 +0100 Subject: Pass '-r' option to 'collie cluster status'. The 'collie cluster status' default output is more verbose since sheepdog 0.24. The '-r' (raw) option has been added for less verbose output but won't be used to ensure compatibility with pre-0.24 sheepdog. Change-Id: Ie31bdded928772250515e439016fc5c5beb00d83 --- nova/volume/driver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/volume/driver.py b/nova/volume/driver.py index 86161d068..606b5b507 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -537,8 +537,11 @@ class SheepdogDriver(VolumeDriver): def check_for_setup_error(self): """Returns an error if prerequisites aren't met""" try: + #NOTE(francois-charlier) Since 0.24 'collie cluster info -r' + # gives short output, but for compatibility reason we won't + # use it and just check if 'running' is in the output. (out, err) = self._execute('collie', 'cluster', 'info') - if not out.startswith('running'): + if not 'running' in out.split(): raise exception.Error(_("Sheepdog is not working: %s") % out) except exception.ProcessExecutionError: raise exception.Error(_("Sheepdog is not working")) -- cgit