Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
delete backend catch exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Feb 22, 2021
1 parent 6600c70 commit 853bff1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions VirtualMachineService/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
import datetime
import json
import logging
from distutils.version import LooseVersion
import os
import parser
import socket
import time
import urllib
from contextlib import closing
from distutils.version import LooseVersion

import os
import redis
import requests as req
import yaml
Expand Down Expand Up @@ -1440,7 +1440,10 @@ def delete_backend(self, id):
verify=True,
)
if response.status_code != 200:
return str(response.json())
try:
return str(response.json())
except json.JSONDecodeError:
return response.content
elif response.status_code == 200:
return str(True)
except Timeout as e:
Expand Down

0 comments on commit 853bff1

Please sign in to comment.