From 8a07c9b2349633a603da5b1bea9bf5ea3fa320b7 Mon Sep 17 00:00:00 2001 From: Jan Tulak Date: Thu, 24 Jan 2019 13:59:02 +0100 Subject: [PATCH] ssmlib: fix pwquality support for python3 The pwquality.PWQError has some differences between Python 2 and 3. The semantics for P3 works for P2, but not the other way around, so use ex.args instead of a simple ex. Resolves: rhbz#1670714 Signed-off-by: Jan Tulak --- ssmlib/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssmlib/main.py b/ssmlib/main.py index 1e323df..102e30c 100644 --- a/ssmlib/main.py +++ b/ssmlib/main.py @@ -1790,8 +1790,8 @@ class StorageHandle(object): pwq = pwquality.PWQSettings() pwq.check(password) except pwquality.PWQError as ex: - if not PR.check(PR.WEAK_PASSWORD, ex[1]): - raise problem.WeakPassword(ex[1]) + if not PR.check(PR.WEAK_PASSWORD, ex.args[1]): + raise problem.WeakPassword(ex.args[1]) else: force_weak_password = True -- 2.20.1