Changes to bodhi automated pushes and handling stderr
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
This commit is contained in:
parent
8b6a9db705
commit
b69dfd1ba0
1 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import requests
|
||||
import json
|
||||
import subprocess
|
||||
|
@ -7,6 +10,11 @@ req = requests.get('https://bodhi.fedoraproject.org/composes/')
|
|||
bodhi_composes = req.json()
|
||||
|
||||
if len(bodhi_composes['composes']) == 0:
|
||||
bodhi_push_cmd = ["bodhi-push", "--username", "releng"]
|
||||
push = subprocess.Popen(bodhi_push_cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE)
|
||||
bodhi_push_cmd = ['bodhi-push', '--username', 'releng']
|
||||
push = subprocess.Popen(bodhi_push_cmd, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
push.stdin.write('y')
|
||||
_, err = push.communicate()
|
||||
push.wait()
|
||||
if push.returncode != 0:
|
||||
print(err, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue