imperva / imperva/imperva-sdk-python
WAF only license triggers 'This feature is currently not licensed.', 'error-code': 'IMP-10129'}
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
for a WAF only FLEX AWS license, below error sometimes happens:
File "/usr/lib/python3.8/site-packages/imperva_sdk/DbService.py", line 100, in _get_all_db_services
res = connection._mx_api('GET', '/conf/dbServices/%s/%s' % (Site, ServerGroup))
File "/usr/lib/python3.8/site-packages/imperva_sdk/MxConnection.py", line 261, in _mx_api
raise MxException("MX returned errors - %s" % str(error_message))
imperva_sdk.core.MxException: MX returned errors - [{'description': 'This feature is currently not licensed.', 'error-code': 'IMP-10129'}]
The fix that seems to work (for me) is:
ServerGroup.py - get_all_db_services(self) be slightly modified to return empty list [] when an exception happens =>
def get_all_db_services(self):
try:
return self._connection.get_all_db_services(Site=self._Site, ServerGroup=self.Name)
except:
return []
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ServerGroup.py at get_all_db_services and trace its call to the SDK's database-services request in DbService.py and MxConnection.py. Reproduce the WAF-only FLEX AWS license case, then verify that the intended result is an empty database-service list rather than IMP-10129, while checking the repository's existing tests for the affected path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100