replace xmlrpc_client exception with requests

It is broken in startup function for kojid and kojivmd from the
introduction of requests.

Fixes: https://pagure.io/koji/issue/1914
This commit is contained in:
Tomas Kopecek 2020-01-06 14:37:00 +01:00
parent c30c4a48fd
commit 638f6cc6f2
5 changed files with 14 additions and 11 deletions

View file

@ -108,7 +108,7 @@ def get_usage_str(usage):
def ensure_connection(session):
try:
ret = session.getAPIVersion()
except six.moves.xmlrpc_client.ProtocolError:
except requests.exceptions.ConnectionError:
error(_("Error: Unable to connect to server"))
if ret != koji.API_VERSION:
warn(_("WARNING: The server is at API version %d and the client is at %d" % (ret, koji.API_VERSION)))