From 276f9fbe293578002f54ffb21cbff6e773af93bc Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Dec 20 2018 09:38:45 +0000 Subject: create_review: remove fedora-cert completely --- diff --git a/src/FedoraReview/create_review.py b/src/FedoraReview/create_review.py index 88b649f..5eb6a46 100644 --- a/src/FedoraReview/create_review.py +++ b/src/FedoraReview/create_review.py @@ -43,24 +43,6 @@ from xmlrpclib import Fault import rpm from bugzilla.rhbugzilla import RHBugzilla -try: - from fedora_cert import read_user_cert as read_fas_user -except ImportError: - def read_fas_user(): - """ Try to read FAS username """ - if os.path.exists(os.path.expanduser('~/.fedora.upn')): - with open(os.path.expanduser('~/.fedora.upn'), 'r') as f: - return f.read().replace('\n', '') - - klist_line = 'Default principal: ' - koutput = check_output('klist', universal_newlines=True).split('\n') - line = [l for l in koutput if l.startswith(klist_line)][0] - line = line[len(klist_line):] - if line.endswith('@FEDORAPROJECT.ORG'): - return line[:line.index('@')] - - raise Exception('Could not determine FAS username') - SETTINGS_FILE = os.path.join(os.environ['HOME'], '.config', 'fedora-create-review') @@ -80,6 +62,22 @@ if '--debug' in sys.argv: LOG.setLevel(logging.DEBUG) +def read_fas_user(): + """ Try to read FAS username """ + if os.path.exists(os.path.expanduser('~/.fedora.upn')): + with open(os.path.expanduser('~/.fedora.upn'), 'r') as f: + return f.read().replace('\n', '') + + klist_line = 'Default principal: ' + koutput = check_output('klist', universal_newlines=True).split('\n') + line = [l for l in koutput if l.startswith(klist_line)][0] + line = line[len(klist_line):] + if line.endswith('@FEDORAPROJECT.ORG'): + return line[:line.index('@')] + + raise Exception('Could not determine FAS username') + + def create_conf(configfile): """Check if the provided configuration file exists, generate the folder if it does not and return True or False according to the