qa/cephadm: FileNotFoundError doesn't exist in py2

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
Sebastian Wagner 2020-05-29 16:04:20 +02:00
parent 1521908830
commit eddb6354e1

View File

@ -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))