mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-31 09:20:43 +08:00
Changes to bodhi automated pushes and handling stderr
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user