From 6fb92e8fb9a8273387efd3d00ce7bf3045ac73a7 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Fri, 14 May 2021 11:44:23 -0500
Subject: [PATCH] Fix E722 do not use bare except

---
 dev_rmq_agents/ohpc_account_create.py | 2 +-
 dev_rmq_agents/ood_account_create.py  | 2 +-
 dev_rmq_agents/slurm_agent.py         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dev_rmq_agents/ohpc_account_create.py b/dev_rmq_agents/ohpc_account_create.py
index 44c8f90..5cdabd5 100644
--- a/dev_rmq_agents/ohpc_account_create.py
+++ b/dev_rmq_agents/ohpc_account_create.py
@@ -20,7 +20,7 @@ def ohpc_account_create(ch, method, properties, body):
         subprocess.call(["sudo", "useradd", username])
         print("[{}]: User {} has been added".format(task, username))
         success = True
-    except:
+    except Exception:
         e = sys.exc_info()[0]
         print("[{}]: Error: {}".format(task, e))
 
diff --git a/dev_rmq_agents/ood_account_create.py b/dev_rmq_agents/ood_account_create.py
index e87124f..de4ed8a 100644
--- a/dev_rmq_agents/ood_account_create.py
+++ b/dev_rmq_agents/ood_account_create.py
@@ -24,7 +24,7 @@ def ood_account_create(ch, method, properties, body):
         )
         print("[{}]: User {} has been added".format(task, username))
         success = True
-    except:
+    except Exception:
         e = sys.exc_info()[0]
         print("[{}]: Error: {}".format(task, e))
 
diff --git a/dev_rmq_agents/slurm_agent.py b/dev_rmq_agents/slurm_agent.py
index eacc44c..f6c4350 100755
--- a/dev_rmq_agents/slurm_agent.py
+++ b/dev_rmq_agents/slurm_agent.py
@@ -40,7 +40,7 @@ def slurm_account_create(ch, method, properties, body):
         )
         print("SLURM account for user {} has been added".format(username))
         success = True
-    except:
+    except Exception:
         e = sys.exc_info()[0]
         print("[{}]: Error: {}".format(task, e))
 
-- 
GitLab