Skip to content

Commit

Permalink
Merge pull request #722 from ntkathole/workaround_rcm
Browse files Browse the repository at this point in the history
Warn only if return code is not 0
  • Loading branch information
jyejare committed Aug 30, 2018
2 parents 31695cd + 06187d4 commit 984c4e3
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions automation_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

from bs4 import BeautifulSoup
from fabric.api import env, run
from fabric.api import env, run, warn_only

from six.moves.urllib.request import urlopen

Expand Down Expand Up @@ -148,25 +148,26 @@ def compare_builds(url1, url2):
list1.sort()
list2 = get_packages_name(urlopen(url2).read())
list2.sort()
try:
run('mkdir packages')
for pkg in range(len(list2)):
get_packages(url2, list2[pkg])
for pkg in range(len(list2)):
if 'NOT OK' not in run('rpm -K packages/' + list1[pkg]):
flag1 = flag1 + 1
if signature in run(
'rpm -qpi packages/' +
list2[pkg] + '| grep "Signature" '
):
flag2 = flag2 + 1
with warn_only():
try:
run('mkdir packages')
for pkg in range(len(list2)):
get_packages(url2, list2[pkg])
for pkg in range(len(list2)):
if 'NOT OK' not in run('rpm -K packages/' + list1[pkg]):
flag1 = flag1 + 1
if signature in run(
'rpm -qpi packages/' +
list2[pkg] + '| grep "Signature" '
):
flag2 = flag2 + 1
else:
print('signature ' + signature + ' not matched for '
+ list2[pkg])
else:
print('signature ' + signature + ' not matched for '
+ list2[pkg])
else:
print(list2[pkg] + 'package is not signed')
finally:
run('rm packages -rf')
print(list2[pkg] + 'package is not signed')
finally:
run('rm packages -rf')

print("========================= Overall Report ======================")

Expand Down

0 comments on commit 984c4e3

Please sign in to comment.