From e160bcf2374ccfdb0fd06688171dc57c2afed0d1 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 12 Jun 2017 17:40:24 +0530 Subject: [PATCH] Correct fail_json call in rpm_key Signed-off-by: Abhijeet Kasurde --- lib/ansible/modules/packaging/os/rpm_key.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/packaging/os/rpm_key.py b/lib/ansible/modules/packaging/os/rpm_key.py index 73c7cc9670..4028c36a1e 100644 --- a/lib/ansible/modules/packaging/os/rpm_key.py +++ b/lib/ansible/modules/packaging/os/rpm_key.py @@ -161,7 +161,7 @@ class RpmKey(object): gpg = self.module.get_bin_path('gpg2') if not gpg: - self.json_fail(msg="rpm_key requires a command line gpg or gpg2, none found") + self.module.fail_json(msg="rpm_key requires a command line gpg or gpg2, none found") stdout, stderr = self.execute_command([gpg, '--no-tty', '--batch', '--with-colons', '--fixed-list-mode', '--list-packets', keyfile]) for line in stdout.splitlines(): @@ -170,7 +170,7 @@ class RpmKey(object): # We want just the last 8 characters of the keyid keyid = line.split()[-1].strip()[8:] return keyid - self.json_fail(msg="Unexpected gpg output") + self.module.fail_json(msg="Unexpected gpg output") def is_keyid(self, keystr): """Verifies if a key, as provided by the user is a keyid"""