summaryrefslogtreecommitdiff
path: root/ironic_python_agent/tests
diff options
context:
space:
mode:
authorRiccardo Pittau <elfosardo@gmail.com>2019-02-04 09:47:52 +0100
committerRiccardo Pittau <elfosardo@gmail.com>2019-02-04 09:55:08 +0100
commitd525f8a07f2b223f7c7455a8fa4c8aad9b914d9b (patch)
tree301cdd4912d1d7ed33ac836b1869323a24818549 /ironic_python_agent/tests
parenta365ff42458a623f6eecb8838f7c809d6cafa37d (diff)
downloadironic-python-agent-d525f8a07f2b223f7c7455a8fa4c8aad9b914d9b.tar.gz
Making ironic-python-agent able to stop with python 3.x
The agent stop function will write a byte string 'a' to the pipe as a signal for the run function to end process. The run function is expecting a literal string. In python 2.x the byte string will automatically be converted to literal, while python 3.x won't do the conversion, causing the process to never stop. This patch will fix that behavior, allowing the IPA to correctly stop using python 3.x. Story: 2004928 Task: 29308 Change-Id: Iad16e8bed2436d961dea8ddaec1c2724225b4097
Diffstat (limited to 'ironic_python_agent/tests')
-rw-r--r--ironic_python_agent/tests/unit/test_agent.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ironic_python_agent/tests/unit/test_agent.py b/ironic_python_agent/tests/unit/test_agent.py
index 3a9024c8..ba529bae 100644
--- a/ironic_python_agent/tests/unit/test_agent.py
+++ b/ironic_python_agent/tests/unit/test_agent.py
@@ -111,7 +111,7 @@ class TestHeartbeater(ironic_agent_base.IronicAgentTest):
expected_poll_calls.append(mock.call(1000 * 25.0))
# Stop now
poll_responses.append(True)
- mock_read.return_value = 'a'
+ mock_read.return_value = b'a'
# Hook it up and run it
mock_time.side_effect = time_responses