Skip to content
Snippets Groups Projects
Commit 7b651654 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

ganeti-noded: Fix bug when export didn't succeed for all disks


snap_disks can contain boolean values. They weren't handled correctly.
The error message was “Error while executing backend function: Invalid
object passed to FromDict: expected dict, got <type 'bool'>”.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent cf26a87a
No related branches found
No related tags found
No related merge requests found
......@@ -355,8 +355,14 @@ class NodeHttpServer(http.server.HttpServer):
"""
instance = objects.Instance.FromDict(params[0])
snap_disks = [objects.Disk.FromDict(str_data)
for str_data in params[1]]
snap_disks = []
for disk in params[1]:
if isinstance(disk, bool):
snap_disks.append(disk)
else:
snap_disks.append(objects.Disk.FromDict(disk))
return backend.FinalizeExport(instance, snap_disks)
@staticmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment