forked from odoo-ecuador/odoo-ecuador
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.py
27 lines (22 loc) · 845 Bytes
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
import requests
WS_TEST_RECEIV = 'https://celcer.sri.gob.ec/comprobantes-electronicos-ws/RecepcionComprobantes?wsdl'
WS_TEST_AUTH = 'https://celcer.sri.gob.ec/comprobantes-electronicos-ws/AutorizacionComprobantes?wsdl'
WS_RECEIV = 'https://cel.sri.gob.ec/comprobantes-electronicos-ws/RecepcionComprobantes?wsdl'
WS_AUTH = 'https://cel.sri.gob.ec/comprobantes-electronicos-ws/AutorizacionComprobantes?wsdl'
def check_service(env='prueba'):
flag = False
if env == 'prueba':
URL = WS_TEST_RECEIV
else:
URL = WS_RECEIV
for i in [1, 2, 3]:
try:
res = requests.head(URL, timeout=3)
print res.status_code
except requests.exceptions.RequestException, e:
print "Error", e
break
if i == 3:
flag = True
return flag