Skip to content

Commit

Permalink
Bug fixes (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
andamian authored Oct 23, 2019
1 parent 6e4e2f9 commit dab8f22
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions vofs/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ long_description = A module and scripts designed for accessing IVAO VOSpace 2.0
author = JJ Kavelaars, Canadian Astronomy Data Centre
author_email = [email protected]
license = AGPLv3
url = http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/vospace
url = https://www.canfar.net/en/docs/storage
edit_on_github = False
github_project = opencadc/vostools
install_requires = vos>=3.0.3 BitVector>=3.4.4,<4.0 fusepy>=2.0.4
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
version = 3.0.2
version = 3.0.3

[entry_points]
#astropy-package-template-example = packagename.example_mod:main
Expand Down
6 changes: 6 additions & 0 deletions vofs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ def run_tests(self):
license=LICENSE,
url=URL,
long_description=readme(),
project_urls={
'Source': 'https://github.com/opencadc/vostoolsa',
'Travis CI': 'https://travis-ci.org/opencadc/vostools',
'Issues': 'https://travis-ci.org/opencadc/vostools/issues',
'VOSpace Standard': 'http://www.ivoa.net/documents/VOSpace/'
},
zip_safe=False,
use_2to3=False,
setup_requires=['pytest-runner'],
Expand Down
5 changes: 3 additions & 2 deletions vos/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ description = CADC VOS Class Libraries
author = JJ Kavelaars, Canadian Astronomy Data Centre
author_email = [email protected]
license = AGPLv3
url = http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/vospace
url = https://www.canfar.net/en/docs/storage
edit_on_github = False
github_project = opencadc/vostools
install_requires = html2text>=2016.5.29 cadcutils>=1.1.20 future enum34
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
version = 3.0.14
version = 3.0.15


[entry_points]
vcat = vos.commands.vcat:vcat
Expand Down
6 changes: 6 additions & 0 deletions vos/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ def run_tests(self):
license=LICENSE,
url=URL,
long_description=readme(),
project_urls={
'Source': 'https://github.com/opencadc/vostoolsa',
'Travis CI': 'https://travis-ci.org/opencadc/vostools',
'Issues': 'https://travis-ci.org/opencadc/vostools/issues',
'VOSpace Standard': 'http://www.ivoa.net/documents/VOSpace/'
},
zip_safe=False,
use_2to3=False,
setup_requires=['pytest-runner'],
Expand Down
14 changes: 11 additions & 3 deletions vos/vos/vos.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,8 @@ def __init__(self, url_list, connector, method, size=None,
follow_redirect=True, byte_range=None,
possible_partial_read=False):
self.closed = True
assert isinstance(connector, Connection)
if not isinstance(connector, Connection):
raise AttributeError("BUG: Connection expected")
self.connector = connector
self.httpCon = None
self.timeout = -1
Expand Down Expand Up @@ -1408,6 +1409,11 @@ def __init__(self, vospace_certfile=None, root_node=None, conn=None,
:type secure_get: bool
"""

if os.getenv('VOSPACE_WEBSERVICE', None):
msg = 'Using custom host: env.VOSPACE_WEBSERVICE={}'.\
format(os.getenv('VOSPACE_WEBSERVICE', None))
logging.getLogger().warning(msg)

if not isinstance(conn, Connection):
vospace_certfile = vospace_certfile is None and\
Client.VOSPACE_CERTFILE or vospace_certfile
Expand Down Expand Up @@ -1752,7 +1758,10 @@ def copy(self, source, destination, send_md5=False, disposition=False,
self.conn.session.put(put_url, data=fin)
node = self.get_node(destination, limit=0, force=True)
destination_md5 = node.props.get('MD5', ZERO_MD5)
assert destination_md5 == source_md5
if destination_md5 != source_md5:
raise Exception(
"Source md5 ({}) != destination md5 ({})".
format(source_md5, destination_md5))
except Exception as ex:
copy_failed_message = str(ex)
logging.debug("FAILED to PUT to {0}".format(put_url))
Expand Down Expand Up @@ -2052,7 +2061,6 @@ def get_node_url(self, uri, method='GET', view=None, limit=None,
response = self.conn.session.get(endpoints.transfer, params=args,
headers=headers,
allow_redirects=False)
assert isinstance(response, requests.Response)
logging.debug("Transfer Server said: {0}".format(response.content))

if response.status_code == 303:
Expand Down

0 comments on commit dab8f22

Please sign in to comment.