From 9135c0eae75c98a524550f653c740212b407db48 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Wed, 8 Jun 2022 16:04:16 -0500
Subject: [PATCH] Fix pylint unnecessary-dunder-call

---
 init_user_state.py                  | 2 +-
 prod_rmq_agents/get-next-uid-gid.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/init_user_state.py b/init_user_state.py
index f539d2c..15f9479 100644
--- a/init_user_state.py
+++ b/init_user_state.py
@@ -26,7 +26,7 @@ size = 1000
 db = dataset.connect(f"sqlite:///{rcfg.db_path}/user_reg.db")
 table = db["user_state"]
 
-if table.__len__() > 0 and not args.force:
+if len(table) > 0 and not args.force:
     print("table user_state not empty, abort.")
     sys.exit()
 
diff --git a/prod_rmq_agents/get-next-uid-gid.py b/prod_rmq_agents/get-next-uid-gid.py
index a6a6d53..0fc40c8 100644
--- a/prod_rmq_agents/get-next-uid-gid.py
+++ b/prod_rmq_agents/get-next-uid-gid.py
@@ -31,7 +31,7 @@ def create_account(msg):
     msg["success"] = False
 
     # Bright command to create user
-    if str(rcfg.bright_cm_version).split(".")[0] == "8":
+    if str(rcfg.bright_cm_version).split(".", maxsplit=1)[0] == "8":
         cmd = "/cm/local/apps/cmd/bin/cmsh -c "
         cmd += f'"user; add {username}; set userid {uid}; set email {email};'
         cmd += f'set commonname \\"{fullname}\\"; '
-- 
GitLab