From 12c5f89ddb51a1db9399e03591e1db6c429b9c9e Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 22 Nov 2019 15:51:00 +0100 Subject: [PATCH] ceph-volume: python2 raises OSError on Popen with missing binary. For compatibility alias FileNotFoundError to OSError. Fixes: 72b79f71fa84fe0d56b2fd1745f5bb130380cc38 Fixes: https://tracker.ceph.com/issues/42967 Signed-off-by: Jan Fajerski --- src/ceph-volume/ceph_volume/util/system.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ceph-volume/ceph_volume/util/system.py b/src/ceph-volume/ceph_volume/util/system.py index 100bcd7b0d2..5aaca59af75 100644 --- a/src/ceph-volume/ceph_volume/util/system.py +++ b/src/ceph-volume/ceph_volume/util/system.py @@ -8,6 +8,12 @@ import uuid from ceph_volume import process, terminal from . import as_string +# python2 has no FileNotFoundError +try: + FileNotFoundError +except NameError: + FileNotFoundError = OSError + logger = logging.getLogger(__name__) mlogger = terminal.MultiLogger(__name__) -- 2.39.5