diff options
author | Dennis Gilmore <dennis@ausil.us> | 2010-08-19 07:51:14 -0500 |
---|---|---|
committer | Dennis Gilmore <dennis@ausil.us> | 2010-08-19 07:51:14 -0500 |
commit | beb4b618e51187d85aecc7c3cbfd4848f5770ad0 (patch) | |
tree | 0667d1a066067741b6236cedd4b4e23368707ab1 /src | |
parent | cc15ec128745cd663b93fbc12c114999a220c53d (diff) | |
download | fedora-packager-beb4b618e51187d85aecc7c3cbfd4848f5770ad0.tar.gz fedora-packager-beb4b618e51187d85aecc7c3cbfd4848f5770ad0.tar.xz fedora-packager-beb4b618e51187d85aecc7c3cbfd4848f5770ad0.zip |
pull the username from fedora_cert to pass to bodhi
Diffstat (limited to 'src')
-rwxr-xr-x | src/fedpkg.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py index 2d01681..0a60b64 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -692,16 +692,23 @@ def update(args): # Suggest that users restart after update suggest_reboot=False\ """ - args = {'nvr': nvr, 'bugs': ''} + if not args.user: + try: + args.user = fedora_cert.read_user_cert() + except: + log.debug('Could not read Fedora cert, using login name') + args.user = os.getlogin() + + bodhi_args = {'nvr': nvr, 'bugs': ''} # Extract bug numbers from the latest changelog entry mymodule.clog() clog = file('clog').read() bugs = re.findall(r'#([0-9]*)', clog) if bugs: - args['bugs'] = ','.join(bugs) + bodhi_args['bugs'] = ','.join(bugs) - template = textwrap.dedent(template) % args + template = textwrap.dedent(template) % bodhi_args # Calculate the hash of the unaltered template orig_hash = hashlib.new('sha1') @@ -721,8 +728,7 @@ def update(args): hash = pyfedpkg._hash_file('bodhi.template', 'sha1') if hash != orig_hash: cmd = ['bodhi', '--new', '--release', mymodule.branch, '--file', - 'bodhi.template', nvr, '--username', - os.getenv('BODHI_USER', os.getenv('USER'))] + 'bodhi.template', nvr, '--username', args.user] pyfedpkg._run_command(cmd, shell=True) else: log.info('Bodhi update aborted!') |