X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=plugins%2FOpenStack%2Fcommon.py;h=c892a302e73575ba82d27b81dd9bf1c7e191f304;hb=refs%2Fchanges%2F78%2F5578%2F1;hp=fe72acc4e18d7076330df05fe3f0a41a9b8d2521;hpb=4bebd121a214bf764a3ec501c97c31915ee5335f;p=osm%2FMON.git diff --git a/plugins/OpenStack/common.py b/plugins/OpenStack/common.py index fe72acc..c892a30 100644 --- a/plugins/OpenStack/common.py +++ b/plugins/OpenStack/common.py @@ -82,16 +82,11 @@ class Common(object): headers = {'X-Auth-Token': auth_token, 'Content-type': 'application/json'} # perform request and return its result - response = None try: if req_type == "put": response = requests.put( url, data=payload, headers=headers, timeout=1) - elif req_type == "post": - response = requests.post( - url, data=payload, headers=headers, - timeout=1) elif req_type == "get": response = requests.get( url, params=params, headers=headers, timeout=1) @@ -99,7 +94,9 @@ class Common(object): response = requests.delete( url, headers=headers, timeout=1) else: - log.warn("Invalid request type") + response = requests.post( + url, data=payload, headers=headers, + timeout=1) except Exception as e: log.warn("Exception thrown on request", e)