components/openstack/swift/patches/manager.patch
changeset 1896 f83e6dde6c3b
child 1944 56ac2df1785b
equal deleted inserted replaced
1895:1f133713df64 1896:f83e6dde6c3b
       
     1 We want to put the swift server executables in /usr/lib/swift, which means
       
     2 that we need to be able to call them from there.  We do so by using the
       
     3 "executable" keyword argument to subprocess.Popen() (and allow for it to be
       
     4 mocked out during testing).
       
     5 
       
     6 This patch is not suitable for pushing upstream.
       
     7 
       
     8 diff --git a/swift/common/manager.py b/swift/common/manager.py
       
     9 --- a/swift/common/manager.py
       
    10 +++ b/swift/common/manager.py
       
    11 @@ -532,7 +532,8 @@ class Server():
       
    12                  re_out = subprocess.PIPE
       
    13              else:
       
    14                  re_out = open(os.devnull, 'w+b')
       
    15 -        proc = subprocess.Popen(args, stdout=re_out, stderr=re_err)
       
    16 +        proc = subprocess.Popen(args, stdout=re_out, stderr=re_err,
       
    17 +            executable='/usr/lib/swift/' + self.cmd)
       
    18          pid_file = self.get_pid_file_name(conf_file)
       
    19          write_file(pid_file, proc.pid)
       
    20          self.procs.append(proc)
       
    21 diff --git a/test/unit/common/test_manager.py b/test/unit/common/test_manager.py
       
    22 --- a/test/unit/common/test_manager.py
       
    23 +++ b/test/unit/common/test_manager.py
       
    24 @@ -816,7 +816,7 @@ class TestServer(unittest.TestCase):
       
    25          class MockProc():
       
    26  
       
    27              def __init__(self, pid, args, stdout=MockProcess.NOTHING,
       
    28 -                         stderr=MockProcess.NOTHING):
       
    29 +                         stderr=MockProcess.NOTHING, executable=None):
       
    30                  self.pid = pid
       
    31                  self.args = args
       
    32                  self.stdout = stdout