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

Problem with reverse lookups #90

Closed
chStaiger opened this issue Jun 21, 2016 · 4 comments
Closed

Problem with reverse lookups #90

chStaiger opened this issue Jun 21, 2016 · 4 comments
Assignees
Labels

Comments

@chStaiger
Copy link

I am working with the epicclient2.py from B2SAFE and the B2HANDLE library.
On the same machine and with the same python compiler I arrive at the following error for the reverse lookups.

Everything works fine with the epicclient2:

admin@ubuntu:$ ./epicclient2.py os credentials/cred_b2handle/credentials.json search URL www.google.com
["841/3f066d3a-3794-11e6-98f1-04040a6400cb"]admin@ubuntu:
$

However, when I am trying to execute tha same commands from the function outside of the script I reeive this:

admin@ubuntu:~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from b2handle.handleclient import EUDATHandleClient
from b2handle.clientcredentials import PIDClientCredentials
cred = PIDClientCredentials.load_from_JSON('credentials/cred_b2handle/credentials.json')
reverselookup_username = cred.get_prefix()
reverselookup_password = cred.get_password()
client = EUDATHandleClient.instantiate_for_read_and_search(
... cred.get_server_URL(),
... reverselookup_username,
... reverselookup_password
... )
args = dict([('URL', 'www.google.com')])
result = client.search_handle(*_args)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/b2handle-1.0.2-py2.7.egg/b2handle/handleclient.py", line 959, in search_handle
list_of_handles = self.__searcher.search_handle(URL=URL, prefix=prefix, *_key_value_pairs)
File "/usr/local/lib/python2.7/dist-packages/b2handle-1.0.2-py2.7.egg/b2handle/searcher.py", line 224, in search_handle
resp = self.__send_revlookup_get_request(query)
File "/usr/local/lib/python2.7/dist-packages/b2handle-1.0.2-py2.7.egg/b2handle/searcher.py", line 357, in __send_revlookup_get_request
resp = self.__session.get(entirequery, headers=head, verify=veri)
AttributeError: 'NoneType' object has no attribute ‘get'

@merretbuurman merretbuurman self-assigned this Jun 21, 2016
@merretbuurman
Copy link
Contributor

Hi,
thanks for posting the issue. I've found the problem and created a fix. I'll make a release as soon as I am back to office.

TobiasWeigel pushed a commit that referenced this issue Jul 8, 2016
* Credentials: Added method to get all credentials.

* Credentials: Added methods for rev lookup params, as they are not in 'additional config'.

* Searcher module: Improved checking/warning if required params are there.

* Instantiation with credentials now simpler.

* Bugfixes in clientcredentials.
@merretbuurman
Copy link
Contributor

PR #93 repairs unit tests affected by this fix.

@merretbuurman
Copy link
Contributor

This issue will be closed when PR #93 is merged and released.

@merretbuurman
Copy link
Contributor

Fixed in release 1.0.3, released on 2016-07-21.

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

No branches or pull requests

2 participants