From 40a84de65ae870c363587b3cacb1c1308eee069e Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Mon, 30 Jul 2012 15:49:02 +0000 Subject: Xen: VHD sequence validation should handle swap. The VHD sequence validation code was erroneously counting `swap.vhd`, which caused it to raise an exception when a corresponding numbered VHD was not found. The fix is to simply ignore the `swap.vhd` file. Other unknown VHDs will generate an exception, but from a sanity-checking perspective, this is a Good Thing(tm). Fixes bug 1030939 Change-Id: Ic82ae27a4af7ea8f7669fd006aea1a310b691218 --- plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py index bd9286658..37de1ecff 100644 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py @@ -219,6 +219,9 @@ def _validate_sequenced_vhds(staging_path): if not filename.endswith('.vhd'): continue + if filename == "swap.vhd": + continue + vhd_path = os.path.join(staging_path, "%d.vhd" % seq_num) if not os.path.exists(vhd_path): raise Exception("Corrupt image. Expected seq number: %d. Files: %s" -- cgit