String to byte conversion should provide the encoding type
Note: In Train we still need to support Python 2.7 so this commit adds import of six and six is used to make correct convertion to bytes in both Python 2.7 and Python 3. Change-Id: Id988cab87d32d5721cd91152df194fbb6fa703c5 Closes-Bug: #1887385 (cherry picked from commit7a56b8f3bc
) (cherry picked from commit18f019984a
) (cherry picked from commit0090884e15
)
This commit is contained in:
parent
9f14638f61
commit
0b1fd4fc26
|
@ -24,6 +24,7 @@ import mock
|
||||||
from neutron_lib import worker as neutron_worker
|
from neutron_lib import worker as neutron_worker
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import psutil
|
import psutil
|
||||||
|
import six
|
||||||
|
|
||||||
from neutron.common import utils
|
from neutron.common import utils
|
||||||
from neutron import manager
|
from neutron import manager
|
||||||
|
@ -221,7 +222,7 @@ class TestWsgiServer(TestNeutronServer):
|
||||||
|
|
||||||
# Memorize a port that was chosen for the service
|
# Memorize a port that was chosen for the service
|
||||||
self.port = server.port
|
self.port = server.port
|
||||||
os.write(self.pipeout, bytes(self.port))
|
os.write(self.pipeout, six.b(str(self.port)))
|
||||||
|
|
||||||
server.wait()
|
server.wait()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue