Commit 44dcbe72 authored by Lucas Carvalho's avatar Lucas Carvalho

Removed MARKER.

MARKER is not required, it just polutes the code.

And should not prevent a bad usage of the library.
parent c31266d1
...@@ -25,9 +25,6 @@ import urlparse ...@@ -25,9 +25,6 @@ import urlparse
import M2Crypto import M2Crypto
_MARKER = ([], [''], None, '')
class NetworkcacheClient(object): class NetworkcacheClient(object):
''' '''
NetworkcacheClient is a wrapper for httplib. NetworkcacheClient is a wrapper for httplib.
...@@ -173,13 +170,13 @@ class NetworkcacheClient(object): ...@@ -173,13 +170,13 @@ class NetworkcacheClient(object):
# Filtering... # Filtering...
data_list = json.loads(data) data_list = json.loads(data)
if len(data_list) > 1 and not \ if len(data_list) > 1 and not \
(self.signature_certificate_file_list in _MARKER or \ (self.signature_certificate_file_list or \
self.signature_certificate_url_list in _MARKER): self.signature_certificate_url_list):
raise DirectoryNotFound('Too many entries for a given directory. ' \ raise DirectoryNotFound('Too many entries for a given directory. ' \
'Directory: %s. Entries: %s.' % (directory_key, str(data_list))) 'Directory: %s. Entries: %s.' % (directory_key, str(data_list)))
if self.signature_certificate_file_list not in _MARKER or \ if self.signature_certificate_file_list or \
self.signature_certificate_url_list not in _MARKER: self.signature_certificate_url_list:
method = self._verifySignatureInCertificateList method = self._verifySignatureInCertificateList
data_list = filter(lambda x: method(x[1]), data_list) data_list = filter(lambda x: method(x[1]), data_list)
if len(data_list) > 1: if len(data_list) > 1:
...@@ -197,7 +194,7 @@ class NetworkcacheClient(object): ...@@ -197,7 +194,7 @@ class NetworkcacheClient(object):
""" """
Return the signature based on certification file. Return the signature based on certification file.
""" """
if self.signature_private_key_file in _MARKER: if self.signature_private_key_file:
return '' return ''
SignEVP = M2Crypto.EVP.load_key(self.signature_private_key_file) SignEVP = M2Crypto.EVP.load_key(self.signature_private_key_file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment