From 0b91a6098f5f2a0e7a0132f121deafc4fccbea7e Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 18 Dec 2014 15:13:44 +0100 Subject: [PATCH] Patch for an Issue #1050 --- plugins/generic/users.py | 19 ++++++++++--------- xml/queries.xml | 8 ++++---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/plugins/generic/users.py b/plugins/generic/users.py index a65f51331..c7c2bc731 100644 --- a/plugins/generic/users.py +++ b/plugins/generic/users.py @@ -424,17 +424,18 @@ class Users: elif Backend.isDbms(DBMS.DB2): privs = privilege.split(",") privilege = privs[0] - privs = privs[1] - privs = list(privs.strip()) - i = 1 + if len(privs) > 1: + privs = privs[1] + privs = list(privs.strip()) + i = 1 - for priv in privs: - if priv.upper() in ("Y", "G"): - for position, db2Priv in DB2_PRIVS.items(): - if position == i: - privilege += ", " + db2Priv + for priv in privs: + if priv.upper() in ("Y", "G"): + for position, db2Priv in DB2_PRIVS.items(): + if position == i: + privilege += ", " + db2Priv - i += 1 + i += 1 privileges.add(privilege) diff --git a/xml/queries.xml b/xml/queries.xml index 521bef313..75185bca0 100644 --- a/xml/queries.xml +++ b/xml/queries.xml @@ -612,8 +612,8 @@ - - + + @@ -626,8 +626,8 @@ - - + +