#974 copr: change how the build status of copr-ping package is retrieved
Closed 2 years ago by schlupov. Opened 2 years ago by schlupov.
fedora-infra/ schlupov/ansible copr_ping_script  into  main

@@ -34,7 +34,19 @@ 

  fi

  

  copr watch-build "$build_id"

- exit_status=$?

+ status=$(copr status "$build_id")

+ if [ "$status" = "failed" ]

+ then

+     exit_status=1

+ elif [ "$status" = "succeeded" ]

+ then

+     exit_status=0

+ elif [ "$status" = "canceled" ]

+ then

+     exit_status=2

+ else

+     exit_status=1000

+ fi

  log

  

  

The copr-ping package appears in nagios as failed even though the build was successful.
It will be maybe safer to find out the status of the build after copr watch-build has finished, using copr status.

I'm not sure if this will help, however, it looks like the problem is in the copr-ping.sh shell script. Even though build 3427362 was successful this script wrote into the log exit_status=1.
And copr status 3427362 returned succeeded which is the correct status.

Pull-Request has been closed by schlupov

2 years ago
Metadata