Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for a missing license (say, product is only WAF licensed), the library is not gracefully treating errors #40

Open
andreireiand opened this issue Nov 29, 2019 · 0 comments

Comments

@andreireiand
Copy link

simple export functions error out:

source_export = mx.export_to_json()
Traceback (most recent call last):

File "", line 1, in
source_export = mx.export_to_json()

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 2152, in export_to_json
site_dict = dict(site)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/core.py", line 43, in iter
iters[child_title].append(dict(child))

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/core.py", line 40, in iter
children = get_all_function()

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/ServerGroup.py", line 198, in get_all_db_services
return self._connection.get_all_db_services(Site=self._Site, ServerGroup=self.Name)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 411, in get_all_db_services
return DbService._get_all_db_services(connection=self, ServerGroup=ServerGroup, Site=Site)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/DbService.py", line 100, in _get_all_db_services
res = connection._mx_api('GET', '/conf/dbServices/%s/%s' % (Site, ServerGroup))

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 257, in _mx_api
raise MxException("MX returned errors - %s" % str(error_message))

MxException: MX returned errors - [{'description': 'This feature is currently not licensed.', 'error-code': 'IMP-10129'}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant