Import HTTPStatus instead of http_client
We don't need an HTTP client for this, we only need status codes. Just load that instead. https://docs.python.org/3/library/http.html Change-Id: Iaccc059aad4d31a413844bfc252d544a591dfc95
This commit is contained in:
parent
2cd4455873
commit
0d3509e28c
|
@ -12,7 +12,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from http import client as http_client
|
||||
from http import HTTPStatus
|
||||
import json
|
||||
import requests
|
||||
|
||||
|
@ -34,5 +34,5 @@ class WebhookPublisher(base.NotificationPublisher):
|
|||
|
||||
LOG.info("Webook request url=%s code=%s", url, resp.status_code)
|
||||
|
||||
if resp.status_code not in [http_client.OK, http_client.CREATED]:
|
||||
if resp.status_code not in [HTTPStatus.OK, HTTPStatus.CREATED]:
|
||||
raise Exception(resp.text)
|
||||
|
|
Loading…
Reference in New Issue