Commit a4bbc371 authored by Rafael Monnerat's avatar Rafael Monnerat

py3: Reduce warnings

parent 7a85f1e3
...@@ -96,7 +96,7 @@ def convertToREST(function): ...@@ -96,7 +96,7 @@ def convertToREST(function):
LOG('SlapTool', INFO, 'Converting ValueError to NotFound, real error:', LOG('SlapTool', INFO, 'Converting ValueError to NotFound, real error:',
error=True) error=True)
raise NotFound(log) raise NotFound(log)
except SoftwareInstanceNotReady as log: except SoftwareInstanceNotReady:
self.REQUEST.response.setStatus(408) self.REQUEST.response.setStatus(408)
self.REQUEST.response.setHeader('Cache-Control', 'private') self.REQUEST.response.setHeader('Cache-Control', 'private')
return self.REQUEST.response return self.REQUEST.response
......
...@@ -93,8 +93,8 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -93,8 +93,8 @@ class testSlapOSMixin(ERP5TypeTestCase):
os.mkdir(os.path.join(ca_path, 'requests')) os.mkdir(os.path.join(ca_path, 'requests'))
os.mkdir(os.path.join(ca_path, 'newcerts')) os.mkdir(os.path.join(ca_path, 'newcerts'))
original_openssl_cnf = open( with open(os.path.join(os.environ['TEST_CA_PATH'], 'openssl.cnf'), "r") as f:
os.path.join(os.environ['TEST_CA_PATH'], 'openssl.cnf'), "r").read() original_openssl_cnf = f.read()
openssl_cnf_with_updated_path = original_openssl_cnf.replace( openssl_cnf_with_updated_path = original_openssl_cnf.replace(
os.environ['TEST_CA_PATH'], ca_path) os.environ['TEST_CA_PATH'], ca_path)
...@@ -113,9 +113,13 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -113,9 +113,13 @@ class testSlapOSMixin(ERP5TypeTestCase):
os.path.join(ca_path, 'private', 'cakey.pem')) os.path.join(ca_path, 'private', 'cakey.pem'))
# reset test CA to have it always count from 0 # reset test CA to have it always count from 0
open(os.path.join(ca_path, 'serial'), 'w').write('01') with open(os.path.join(ca_path, 'serial'), "w") as f:
open(os.path.join(ca_path, 'crlnumber'), 'w').write('01') f.write('01')
open(os.path.join(ca_path, 'index.txt'), 'w').write('') with open(os.path.join(ca_path, 'index.txt'), "w") as f:
f.write('01')
with open(os.path.join(ca_path, 'crlnumber'), "w") as f:
f.write('')
private_list = glob.glob('%s/*.key' % os.path.join(ca_path, 'private')) private_list = glob.glob('%s/*.key' % os.path.join(ca_path, 'private'))
for private in private_list: for private in private_list:
os.remove(private) os.remove(private)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment