Skip to content

Commit

Permalink
analyze-migration.py: fix find() type error
Browse files Browse the repository at this point in the history
Traceback (most recent call last):
  File "../scripts/analyze-migration.py", line 611, in <module>
    dump.read(desc_only = True)
  File "../scripts/analyze-migration.py", line 513, in read
    self.load_vmsd_json(file)
  File "../scripts/analyze-migration.py", line 556, in load_vmsd_json
    vmsd_json = file.read_migration_debug_json()
  File "../scripts/analyze-migration.py", line 89, in read_migration_debug_json
    nulpos = data.rfind("\0")
TypeError: argument should be integer or bytes-like object, not 'str'

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Signed-off-by: Cleber Rosa <[email protected]>
  • Loading branch information
elmarco authored and clebergnu committed Dec 16, 2019
1 parent b67d22a commit 13ae8cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/analyze-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def read_migration_debug_json(self):

# Find the last NULL byte, then the first brace after that. This should
# be the beginning of our JSON data.
nulpos = data.rfind("\0")
jsonpos = data.find("{", nulpos)
nulpos = data.rfind(b'\0')
jsonpos = data.find(b'{', nulpos)

# Check backwards from there and see whether we guessed right
self.file.seek(datapos + jsonpos - 5, 0)
Expand Down

0 comments on commit 13ae8cd

Please sign in to comment.