imperva / imperva/imperva-sdk-python

get_all_sites returns whtat's visible in the gui (only the default one) while get_site returns an object that's not existent in the GUI ...

Open
#42 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14
Forks
10
PR merge metrics
No merged PRs in 30d

Description

`
mx.get_all_sites()
Out[199]: []

mx.get_site(Name=siteName)
Out[200]:

site = mx.get_site(Name=siteName)

site.Name
Out[202]: 'Site10x'

mx.get_all_sites()
Out[203]: []

mx.delete_site(Name=siteName)
Traceback (most recent call last):

File "", line 1, in
mx.delete_site(Name=siteName)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 293, in delete_site
return Site._delete_site(connection=self, Name=Name)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/Site.py", line 96, in _delete_site
connection._mx_api('DELETE', '/conf/sites/%s' % Name)

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': 'Site not found', 'error-code': 'IMP-10006'}]

`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing get_all_sites, get_site, and delete_site in imperva_sdk/Site.py and imperva_sdk/MxConnection.py, then reproduce the calls shown in the report against the /conf/sites endpoint. Determine why the listed and individually retrieved sites differ; done means the reported inconsistency no longer occurs and the affected behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.