Commit ddfe2228 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Handle None result from BlockdevFind


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 98825740
......@@ -214,7 +214,12 @@ class NodeHttpServer(http.server.HttpServer):
"""
disk = objects.Disk.FromDict(params[0])
return backend.BlockdevFind(disk).ToDict()
result = backend.BlockdevFind(disk)
if result is None:
return None
return result.ToDict()
@staticmethod
def perspective_blockdev_snapshot(params):
......
......@@ -6309,6 +6309,8 @@ class LUQueryInstanceData(NoHooksLU):
result.Raise("Can't compute disk status for %s" % instance_name)
status = result.payload
if status is None:
return None
return (status.dev_path, status.major, status.minor,
status.sync_percent, status.estimated_time,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment