namespace = get_ns_name(pool_id)
root_ns = ip_lib.IPWrapper(self.root_helper)
- socket_path = self._get_state_file_path(pool_id, 'sock')
+ socket_path = self._get_state_file_path(pool_id, 'sock', False)
if root_ns.netns.exists(namespace) and os.path.exists(socket_path):
try:
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
return False
def get_stats(self, pool_id):
- socket_path = self._get_state_file_path(pool_id, 'sock')
+ socket_path = self._get_state_file_path(pool_id, 'sock', False)
TYPE_BACKEND_REQUEST = 2
TYPE_SERVER_REQUEST = 4
if os.path.exists(socket_path):
mock.patch('socket.socket'),
mock.patch('os.path.exists'),
) as (gsp, ip_wrap, socket, path_exists):
- gsp.side_effect = lambda x, y: '/pool/' + y
+ gsp.side_effect = lambda x, y, z: '/pool/' + y
ip_wrap.return_value.netns.exists.return_value = True
path_exists.return_value = True
mock.patch('socket.socket'),
mock.patch('os.path.exists'),
) as (gsp, socket, path_exists):
- gsp.side_effect = lambda x, y: '/pool/' + y
+ gsp.side_effect = lambda x, y, z: '/pool/' + y
path_exists.return_value = True
socket.return_value = socket
socket.recv.return_value = raw_stats