cmis: upgrade cmislib 0.6 (#18407)
This commit is contained in:
parent
2ac5001685
commit
5070746b0d
|
@ -23,7 +23,7 @@ Depends: ${python:Depends},
|
||||||
python-setuptools,
|
python-setuptools,
|
||||||
python-django-jsonfield,
|
python-django-jsonfield,
|
||||||
python-suds,
|
python-suds,
|
||||||
python-cmislib (>= 0.5), python-cmislib (< 0.6),
|
python-cmislib,
|
||||||
python-lxml,
|
python-lxml,
|
||||||
python-dateutil,
|
python-dateutil,
|
||||||
python-pyproj,
|
python-pyproj,
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
cmislib<0.6.0
|
cmislib
|
||||||
pytest
|
pytest
|
||||||
requests
|
requests
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import functools
|
import functools
|
||||||
|
import httplib2
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import urllib2
|
import urllib2
|
||||||
|
@ -25,8 +26,10 @@ except ImportError:
|
||||||
import StringIO
|
import StringIO
|
||||||
|
|
||||||
from cmislib import CmisClient
|
from cmislib import CmisClient
|
||||||
from cmislib.model import (CmisException, ObjectNotFoundException, PermissionDeniedException,
|
from cmislib.exceptions import CmisException
|
||||||
UpdateConflictException)
|
from cmislib.exceptions import ObjectNotFoundException
|
||||||
|
from cmislib.exceptions import PermissionDeniedException
|
||||||
|
from cmislib.exceptions import UpdateConflictException
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
@ -117,9 +120,8 @@ def wrap_cmis_error(f):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
except urllib2.URLError as e:
|
except (urllib2.URLError, httplib2.HttpLib2Error) as e:
|
||||||
# FIXME when moving to cmislib >= 0.6.0
|
# FIXME urllib2 still used for cmslib 0.5 compat
|
||||||
# httplib2 will probably be used instead of urllib
|
|
||||||
raise APIError("connection error: %s" % e)
|
raise APIError("connection error: %s" % e)
|
||||||
except PermissionDeniedException as e:
|
except PermissionDeniedException as e:
|
||||||
raise APIError("permission denied: %s" % e)
|
raise APIError("permission denied: %s" % e)
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -97,7 +97,7 @@ setup(name='passerelle',
|
||||||
'pyexcel-io',
|
'pyexcel-io',
|
||||||
'pyexcel-ods',
|
'pyexcel-ods',
|
||||||
'pyexcel-xls',
|
'pyexcel-xls',
|
||||||
'cmislib >= 0.5, <0.6',
|
'cmislib',
|
||||||
'pyproj',
|
'pyproj',
|
||||||
'feedparser',
|
'feedparser',
|
||||||
'lxml',
|
'lxml',
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import base64
|
import base64
|
||||||
|
import httplib2
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
from cmislib import CmisClient
|
from cmislib import CmisClient
|
||||||
from cmislib.model import (CmisException, ObjectNotFoundException,
|
from cmislib.exceptions import CmisException
|
||||||
PermissionDeniedException, UpdateConflictException)
|
from cmislib.exceptions import ObjectNotFoundException
|
||||||
|
from cmislib.exceptions import PermissionDeniedException
|
||||||
|
from cmislib.exceptions import UpdateConflictException
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from mock import call, Mock
|
from mock import call, Mock
|
||||||
import py
|
import py
|
||||||
|
@ -263,8 +266,8 @@ def test_create_doc():
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("cmis_exc,err_msg", [
|
@pytest.mark.parametrize("cmis_exc,err_msg", [
|
||||||
# FIXME when moving to cmislib >= 0.6.0
|
(httplib2.HttpLib2Error, "connection error"),
|
||||||
# httplib2 will probably be used instead of urllib
|
# FIXME used for cmslib 0.5 compat
|
||||||
(urllib2.URLError, "connection error"),
|
(urllib2.URLError, "connection error"),
|
||||||
(PermissionDeniedException, "permission denied"),
|
(PermissionDeniedException, "permission denied"),
|
||||||
(UpdateConflictException, "update conflict"),
|
(UpdateConflictException, "update conflict"),
|
||||||
|
|
Loading…
Reference in New Issue