Trivial update

This commit is contained in:
Miroslav Stampar
2017-04-18 15:56:24 +02:00
parent 5f2bb88037
commit 2d05174545
18 changed files with 71 additions and 71 deletions

View File

@@ -161,7 +161,7 @@ class Users:
conf.user = conf.user.upper()
if conf.user:
users = conf.user.split(",")
users = conf.user.split(',')
if Backend.isDbms(DBMS.MYSQL):
for user in users:
@@ -429,7 +429,7 @@ class Users:
# In DB2 we get Y or G if the privilege is
# True, N otherwise
elif Backend.isDbms(DBMS.DB2):
privs = privilege.split(",")
privs = privilege.split(',')
privilege = privs[0]
if len(privs) > 1:
privs = privs[1]
@@ -537,8 +537,8 @@ class Users:
# In PostgreSQL we get 1 if the privilege is True,
# 0 otherwise
if Backend.isDbms(DBMS.PGSQL) and ", " in privilege:
privilege = privilege.replace(", ", ",")
privs = privilege.split(",")
privilege = privilege.replace(", ", ',')
privs = privilege.split(',')
i = 1
for priv in privs:
@@ -557,12 +557,12 @@ class Users:
# In MySQL < 5.0 we get Y if the privilege is
# True, N otherwise
elif Backend.isDbms(DBMS.MYSQL) and not kb.data.has_information_schema:
privilege = privilege.replace(", ", ",")
privs = privilege.split(",")
privilege = privilege.replace(", ", ',')
privs = privilege.split(',')
i = 1
for priv in privs:
if priv.upper() == "Y":
if priv.upper() == 'Y':
for position, mysqlPriv in MYSQL_PRIVS.items():
if position == i:
privileges.add(mysqlPriv)
@@ -580,14 +580,14 @@ class Users:
# In DB2 we get Y or G if the privilege is
# True, N otherwise
elif Backend.isDbms(DBMS.DB2):
privs = privilege.split(",")
privs = privilege.split(',')
privilege = privs[0]
privs = privs[1]
privs = list(privs.strip())
i = 1
for priv in privs:
if priv.upper() in ("Y", "G"):
if priv.upper() in ('Y', 'G'):
for position, db2Priv in DB2_PRIVS.items():
if position == i:
privilege += ", " + db2Priv