Browse Source

Convert int to bytes for py3

The following error raised during the functional test:
"TypeError: unsupported operand type(s) for %: 'bytes' and 'int'"
This patch converts the string to bytes for py3.

Closes-Bug: #1822155
Change-Id: I3de92ef830e5f424aa83b57d8ed843a7c4349e8a
changes/59/648459/3
LIU Yulong 2 years ago
parent
commit
97923ae4a8
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      neutron/agent/linux/daemon.py

+ 2
- 1
neutron/agent/linux/daemon.py View File

@ -24,6 +24,7 @@ import sys
from neutron_lib import exceptions
from oslo_log import log as logging
import six
from neutron._i18n import _
@ -136,7 +137,7 @@ class Pidfile(object):
def write(self, pid):
os.ftruncate(self.fd, 0)
os.write(self.fd, b"%d" % pid)
os.write(self.fd, six.b("%s" % pid))
os.fsync(self.fd)
def read(self):


Loading…
Cancel
Save