We want to put the Swift server executables in /usr/lib/swift, which means
that we need to be able to call them from there. We do so by using the
"executable" keyword argument to subprocess.Popen() (and allow for it to be
mocked out during testing).
This patch is not suitable for pushing upstream.
--- swift-2.7.0/swift/common/manager.py.~1~ 2016-03-25 02:42:55.000000000 -0700
+++ swift-2.7.0/swift/common/manager.py 2016-08-08 18:50:52.318623880 -0700
@@ -655,7 +655,8 @@ class Server(object):
re_out = subprocess.PIPE
else:
re_out = open(os.devnull, 'w+b')
- proc = subprocess.Popen(args, stdout=re_out, stderr=re_err)
+ proc = subprocess.Popen(args, stdout=re_out, stderr=re_err,
+ executable='/usr/lib/swift/' + self.cmd)
pid_file = self.get_pid_file_name(conf_file)
write_file(pid_file, proc.pid)
self.procs.append(proc)
--- swift-2.7.0/test/unit/common/test_manager.py.~1~ 2016-03-25 02:42:55.000000000 -0700
+++ swift-2.7.0/test/unit/common/test_manager.py 2016-08-08 18:50:52.320000055 -0700
@@ -1054,7 +1054,7 @@ class TestServer(unittest.TestCase):
class MockProc(object):
def __init__(self, pid, args, stdout=MockProcess.NOTHING,
- stderr=MockProcess.NOTHING):
+ stderr=MockProcess.NOTHING, executable=None):
self.pid = pid
self.args = args
self.stdout = stdout