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
import M2Crypto
_MARKER = ([], [''], None, '')
class NetworkcacheClient(object):
'''
NetworkcacheClient is a wrapper for httplib.
......@@ -173,13 +170,13 @@ class NetworkcacheClient(object):
# Filtering...
data_list = json.loads(data)
if len(data_list) > 1 and not \
(self.signature_certificate_file_list in _MARKER or \
self.signature_certificate_url_list in _MARKER):
(self.signature_certificate_file_list or \
self.signature_certificate_url_list):
raise DirectoryNotFound('Too many entries for a given directory. ' \
'Directory: %s. Entries: %s.' % (directory_key, str(data_list)))
if self.signature_certificate_file_list not in _MARKER or \
self.signature_certificate_url_list not in _MARKER:
if self.signature_certificate_file_list or \
self.signature_certificate_url_list:
method = self._verifySignatureInCertificateList
data_list = filter(lambda x: method(x[1]), data_list)
if len(data_list) > 1:
......@@ -197,7 +194,7 @@ class NetworkcacheClient(object):
"""
Return the signature based on certification file.
"""
if self.signature_private_key_file in _MARKER:
if self.signature_private_key_file:
return ''
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