#42 Treat xmlrpc error 504 differently
Merged 4 years ago by nphilipp. Opened 4 years ago by pingou.
fedora-infra/ pingou/distgit-bugzilla-sync catch_504  into  master

@@ -453,6 +453,10 @@ 

                              self.server.editcomponent(data)

                              break

                          except Exception as e:

+                             if isinstance(e, xmlrpc.client.Fault) and e.faultCode == 504:

+                                 if self.config['verbose']:

+                                     print(f"    ERROR {e}")

+                                 raise

                              if i >= num_attempts - 1:

                                  raise

                              if self.config['verbose']:
@@ -523,6 +527,10 @@ 

                          self.server.addcomponent(data)

                          break

                      except Exception as e:

+                         if isinstance(e, xmlrpc.client.Fault) and e.faultCode == 504:

+                             if self.config['verbose']:

+                                 print(f"    ERROR {e}")

+                             raise

                          if i >= num_attempts - 1:

                              raise

                          if self.config['verbose']:

The error message for the error 504 reads:

<Fault 504: 'The name XXX is not a valid username. Either you misspelled
it, or the person has not registered for a ... Bugzilla ... account.'>

In other words, the request succeeded but the user does not exist. So
in those situation there are no reasons to keep on trying, it won't work
at the next attempt either.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

Metadata Update from @nphilipp:
- Request assigned

4 years ago

Pull-Request has been merged by nphilipp

4 years ago
Metadata