diff --git a/lib/backend.py b/lib/backend.py index 3e2fa9697c9e79ceeb18451182cd8ad9e5728b92..e3053e9383f272d663c6eac94c0f869e39ea3eb2 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -1461,6 +1461,8 @@ def BlockdevRemovechildren(parent_cdev, new_cdevs): else: devs.append(bd.dev_path) else: + if not utils.IsNormAbsPath(rpath): + _Fail("Strange path returned from StaticDevPath: '%s'", rpath) devs.append(rpath) parent_bdev.RemoveChildren(devs) diff --git a/lib/objects.py b/lib/objects.py index 7fb7d5be6ed872ddb90cb71eccb4497749992d27..6e81a45ea6dbab70fb4d1e5abbb7765cf8092292 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -411,6 +411,9 @@ class Disk(ConfigObject): irrespective of their status. For such devices, we return this path, for others we return None. + @warning: The path returned is not a normalized pathname; callers + should check that it is a valid path. + """ if self.dev_type == constants.LD_LV: return "/dev/%s/%s" % (self.logical_id[0], self.logical_id[1])