Commit 61c32e6a authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify.

parent 0171f96c
......@@ -62,6 +62,7 @@ class NetworkcacheClient(object):
for k, v in self.parseUrl(shacache).iteritems():
setattr(self, 'shacache_%s' % k, v)
self.shacache_url = shacache
self.shadir_url = shadir
# ShaDir Properties
for k, v in self.parseUrl(shadir).iteritems():
......@@ -157,10 +158,9 @@ class NetworkcacheClient(object):
''' Download a file from shacache by selecting the entry in shadir
Raise DirectoryNotFound if multiple files are found.
'''
path_info = os.path.join(self.shadir_path, urlmd5)
url = "http://%s:%s%s" % (self.shadir_host, self.shadir_port, path_info)
request = urllib2.Request(url=url, data=None,headers=self.shadir_header_dict)
url = os.path.join(self.shadir_url, urlmd5)
request = urllib2.Request(url=url, data=None,
headers=self.shadir_header_dict)
try:
result = urllib2.urlopen(request)
data = result.read()
......
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