From eddb6354e157a653962e68d100c6881b5a0fdc24 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 29 May 2020 16:04:20 +0200 Subject: [PATCH] qa/cephadm: FileNotFoundError doesn't exist in py2 Signed-off-by: Sebastian Wagner --- qa/tasks/cephadm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index afcec9cda35..8852c0c7be5 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -4,6 +4,7 @@ Ceph cluster task, deployed via cephadm orchestrator import argparse import configobj import contextlib +import errno import logging import os import json @@ -1186,6 +1187,9 @@ def add_mirror_to_cluster(ctx, mirror): path=registries_conf, data=new_config, ) - except FileNotFoundError as e: + except IOError as e: # py3: use FileNotFoundError instead. + if e.errno != errno.ENOENT: + raise + # Docker doesn't ship a registries.conf log.info('Failed to add mirror: %s' % str(e))