diff --git a/reposync/runreposync.sh b/reposync/runreposync.sh index e0212491fb672391150a0415e96ba107cff07a63..8b19f3cb45659b31c5c7b1acf19dfad4dcd29fd1 100755 --- a/reposync/runreposync.sh +++ b/reposync/runreposync.sh @@ -144,6 +144,23 @@ fi set +x +for rpm in ${CHANGELIST}; do + path=`/usr/bin/find ${REPOPATH} -type f -name "${rpm}"` + info=`/usr/bin/rpm --queryformat "%{NAME} %{VERSION}-%{RELEASE} %{ARCH}" -qp ${path} 2>/dev/null` + name=`echo $info | cut -d' ' -f1` + version=`echo $info | cut -d' ' -f2` + arch=`echo $info | cut -d' ' -f3` + + log `cat << EOF + "message_type": "change", + "rpm_name": "${name}", + "rpm_version": "${version}", + "rpm_arch": "${arch}", + "rpm_filename": "${rpm}" +EOF` + echo +done + # Turn the new-line separated list of changes into a comma-separated list of quoted strings LIST=`sed 's/^/"/;s/$/"/;s/^""$//' <(echo "${CHANGELIST}") | /usr/bin/tr '\n' ',' | sed 's/,$//'` @@ -153,4 +170,4 @@ log `cat << EOF "pre_count": ${PRECOUNT}, "post_count": ${POSTCOUNT}, "changes": [${LIST}] -EOF` | tee $OUTPUT +EOF` > $OUTPUT diff --git a/scheduler/schedule.py b/scheduler/schedule.py index 26bae56478fda8d3be0c7a52164c976d03b8f874..3582fa4610af4483d8a4675fc2ba20f3a0553730 100755 --- a/scheduler/schedule.py +++ b/scheduler/schedule.py @@ -139,20 +139,23 @@ while jobs: log(comment='All done!') final_results = [] for j in results.keys(): - log(comment='Job result', job=j, result=results[j]) + # Filter some stuff that may be too large + r = results[j] + del r['changes'] + r['count_diff'] = r['post_count']-r['pre_count'] + + log(comment='Job result', job=j, result=r) exit_codes = [x[0]['exit_code'] for x in results.values()] total_results_by_exit = dict([(x, exit_codes.count(x)) for x in set(exit_codes)]) total_pre_count = sum([x[0]['pre_count'] for x in results.values()]) total_post_count = sum([x[0]['post_count'] for x in results.values()]) -total_changes = list(itertools.chain.from_iterable([x[0]['changes'] for x in results.values()])) log(comment='Job summary', - #results=results, total_results = len(exit_codes), total_results_by_exit_code = total_results_by_exit, total_pre_count = total_pre_count, total_post_count = total_post_count, - total_changes = total_changes, + total_count_diff = total_post_count-total_pre_count, )