From 62fc4b835cd02444cd3c4cb6530ceb9db8bcc7af Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Tue, 19 Oct 2021 20:55:09 -0400 Subject: [PATCH] EX-4098 lipe: lpcc uses class only in python3 FileNotFoundError is only available from python3. Change it to matching class in python2. Change-Id: I63676ef8ff6a5461a7af6e9177d6bc76e39c0bc5 Signed-off-by: Lei Feng Test-Parameters: trivial testlist=sanity-pcc env=ONLY=200-202,ONLY_REPEAT=50 \ clientextra_install_params="--packages lipe-lpcc" Reviewed-on: https://review.whamcloud.com/45304 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Minh Diep --- lipe/lpcc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lipe/lpcc b/lipe/lpcc index 67ab790..e5ce4ff 100755 --- a/lipe/lpcc +++ b/lipe/lpcc @@ -286,7 +286,7 @@ class LpccMonitor: eprint("Config file '%s' is empty, the service won't do any real work!" % \ config_file) self.config_obj = [] - except FileNotFoundError: + except IOError: # if config file does not exist, it's the same as an empty config file eprint("Config file '%s' does not exist, the service won't do any real work!" % \ config_file) @@ -490,7 +490,7 @@ class LpccCli: try: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(LISTEN_SOCK_FN) - except FileNotFoundError: + except socket.error: eprint("Socket file '%s' does not exist, " % LISTEN_SOCK_FN + \ "please check whether the monitor service started!") sys.exit(1) -- 1.8.3.1