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

Commit

Permalink
Merge pull request #622 from deNBI/delete_backend
Browse files Browse the repository at this point in the history
delete backend catch exception
  • Loading branch information
dweinholz authored Feb 22, 2021
2 parents e5183da + 853bff1 commit 398a66d
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 398a66d

Please sign in to comment.