#1096 Non-zero return code for failing builds when building locally
Merged 5 years ago by jkaluza. Opened 5 years ago by vmaljulin.
vmaljulin/fm-orchestrator FACTORY-3468  into  master

@@ -150,7 +150,7 @@ 

              handle = FileStorage(fd)

              handle.filename = filename

              try:

-                 submit_module_build_from_yaml(

+                 modules_list = submit_module_build_from_yaml(

                      username, handle, str(stream), skiptests, optional_params)

              except StreamAmbigous as e:

                  logging.error(str(e))
@@ -163,6 +163,9 @@ 

          # Run the consumer until stop_condition returns True

          module_build_service.scheduler.main([], stop)

  

+         if any(module.state == models.BUILD_STATES['failed'] for module in modules_list):

+             raise RuntimeError('Module build failed')

+ 

  

  @console_script_help

  @manager.command

Fixes #1063

Signed-off-by: Valerij Maljulin vmaljuli@redhat.com

Should I create a test for this?

Can you describe the return value and type of this function? (Return value is either None or 10 which is pretty strange.)

Ideally, raise an exception if that would work.

if any(module.state == models.BUILD_STATES['failed'] for module in modules_list):
    raise RuntimeError('Module build failed')

rebased onto 74e3a1637d20e9f92773237415e630e22377999d

5 years ago

rebased onto cadb058

5 years ago

Commit cc30385 fixes this pull-request

Pull-Request has been merged by jkaluza

5 years ago

Pull-Request has been merged by jkaluza

5 years ago