Whamcloud - gitweb
EX-4098 lipe: lpcc uses class only in python3
authorLei Feng <flei@whamcloud.com>
Wed, 20 Oct 2021 00:55:09 +0000 (20:55 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 20 Oct 2021 17:06:48 +0000 (17:06 +0000)
FileNotFoundError is only available from python3.
Change it to matching class in python2.

Change-Id: I63676ef8ff6a5461a7af6e9177d6bc76e39c0bc5
Signed-off-by: Lei Feng <flei@whamcloud.com>
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 <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
lipe/lpcc

index 67ab790..e5ce4ff 100755 (executable)
--- 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)