diff --git a/bin/logdaemon.py b/bin/logdaemon.py index 7178fd28..6bf41f5d 100644 --- a/bin/logdaemon.py +++ b/bin/logdaemon.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011-2018 Ghent University +# Copyright 2011-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/__init__.py b/lib/vsc/__init__.py index 06eaee87..b28f931b 100644 --- a/lib/vsc/__init__.py +++ b/lib/vsc/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2018 Ghent University +# Copyright 2015-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/__init__.py b/lib/vsc/utils/__init__.py index 06eaee87..b28f931b 100644 --- a/lib/vsc/utils/__init__.py +++ b/lib/vsc/utils/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2018 Ghent University +# Copyright 2015-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/affinity.py b/lib/vsc/utils/affinity.py index 53b472bb..da3296e4 100644 --- a/lib/vsc/utils/affinity.py +++ b/lib/vsc/utils/affinity.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2018 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/dateandtime.py b/lib/vsc/utils/dateandtime.py index c7e21d0c..a13f488a 100644 --- a/lib/vsc/utils/dateandtime.py +++ b/lib/vsc/utils/dateandtime.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2018 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/docs.py b/lib/vsc/utils/docs.py index fb5d7acb..2bddbcbf 100644 --- a/lib/vsc/utils/docs.py +++ b/lib/vsc/utils/docs.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2018 Ghent University +# Copyright 2015-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/exceptions.py b/lib/vsc/utils/exceptions.py index 70478d6f..16644e6e 100644 --- a/lib/vsc/utils/exceptions.py +++ b/lib/vsc/utils/exceptions.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2018 Ghent University +# Copyright 2015-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/fancylogger.py b/lib/vsc/utils/fancylogger.py index 957e8ee8..bdff4760 100644 --- a/lib/vsc/utils/fancylogger.py +++ b/lib/vsc/utils/fancylogger.py @@ -1,5 +1,5 @@ # -# Copyright 2011-2018 Ghent University +# Copyright 2011-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/generaloption.py b/lib/vsc/utils/generaloption.py index 530c494b..c5d53994 100644 --- a/lib/vsc/utils/generaloption.py +++ b/lib/vsc/utils/generaloption.py @@ -1,5 +1,5 @@ # -# Copyright 2011-2018 Ghent University +# Copyright 2011-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/mail.py b/lib/vsc/utils/mail.py index f4e091c0..8f3a878e 100644 --- a/lib/vsc/utils/mail.py +++ b/lib/vsc/utils/mail.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2018 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/missing.py b/lib/vsc/utils/missing.py index 47a78970..64f37cfd 100644 --- a/lib/vsc/utils/missing.py +++ b/lib/vsc/utils/missing.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2018 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/patterns.py b/lib/vsc/utils/patterns.py index e517c758..3220304f 100644 --- a/lib/vsc/utils/patterns.py +++ b/lib/vsc/utils/patterns.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2018 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/rest.py b/lib/vsc/utils/rest.py index 9db99899..c0b3cd83 100644 --- a/lib/vsc/utils/rest.py +++ b/lib/vsc/utils/rest.py @@ -174,11 +174,14 @@ def request(self, method, url, body, headers, content_type=None): # TODO: in recent python: Context manager conn = self.get_connection(method, url, body, headers) status = conn.code - body = conn.read() - try: - pybody = json.loads(body) - except ValueError: - pybody = body + if method == self.HEAD: + pybody = conn.headers + else: + body = conn.read() + try: + pybody = json.loads(body) + except ValueError: + pybody = body fancylogger.getLogger().debug('reponse len: %s ', len(pybody)) conn.close() return status, pybody diff --git a/lib/vsc/utils/run.py b/lib/vsc/utils/run.py index d871aeb8..aaa3022a 100644 --- a/lib/vsc/utils/run.py +++ b/lib/vsc/utils/run.py @@ -1,5 +1,5 @@ # -# Copyright 2009-2018 Ghent University +# Copyright 2009-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/testing.py b/lib/vsc/utils/testing.py index 28f0a6e9..60ba537f 100644 --- a/lib/vsc/utils/testing.py +++ b/lib/vsc/utils/testing.py @@ -1,5 +1,5 @@ # -# Copyright 2014-2018 Ghent University +# Copyright 2014-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/setup.py b/setup.py index db089ae5..c9b75353 100755 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ ] PACKAGE = { - 'version': '2.8.3', + 'version': '2.8.4', 'author': [sdw, jt, ag, kh], 'maintainer': [sdw, jt, ag, kh], # as long as 1.0.0 is not out, vsc-base should still provide vsc.fancylogger diff --git a/test/00-import.py b/test/00-import.py index 27b778b1..edb4240a 100644 --- a/test/00-import.py +++ b/test/00-import.py @@ -1,5 +1,5 @@ # -# Copyright 2016-2017 Ghent University +# Copyright 2016-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/__init__.py b/test/__init__.py index 68717477..17aeb639 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,16 +1,28 @@ -## -# Copyright 2012-2015 Ghent University # -# This file is part of , +# Copyright 2012-2019 Ghent University +# +# This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), -# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), -# the Hercules foundation (http://www.herculesstichting.be/in_English) +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# the Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # -# All rights reserved. +# https://github.com/hpcugent/vsc-base +# +# vsc-base is free software: you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# vsc-base is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with vsc-base. If not, see . # -## """ Init """ diff --git a/test/asyncprocess.py b/test/asyncprocess.py index 1dadf126..2ccaff20 100644 --- a/test/asyncprocess.py +++ b/test/asyncprocess.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2017 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/dateandtime.py b/test/dateandtime.py index b87507d6..55bd9f3a 100644 --- a/test/dateandtime.py +++ b/test/dateandtime.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2017 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/docs.py b/test/docs.py index c1551711..70c200ed 100644 --- a/test/docs.py +++ b/test/docs.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2017 Ghent University +# Copyright 2015-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/exceptions.py b/test/exceptions.py index c414f4ab..46e8d6cd 100644 --- a/test/exceptions.py +++ b/test/exceptions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2015-2017 Ghent University +# Copyright 2015-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/fancylogger.py b/test/fancylogger.py index 4381a5e2..a1d197f1 100644 --- a/test/fancylogger.py +++ b/test/fancylogger.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2013-2017 Ghent University +# Copyright 2013-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/generaloption.py b/test/generaloption.py index c52cf779..a6d66154 100644 --- a/test/generaloption.py +++ b/test/generaloption.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2018 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/missing.py b/test/missing.py index 2fa2c4f9..b58ff009 100644 --- a/test/missing.py +++ b/test/missing.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2017 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/optcomplete.py b/test/optcomplete.py index 14f0a0ca..a7bfb61e 100644 --- a/test/optcomplete.py +++ b/test/optcomplete.py @@ -1,5 +1,5 @@ # -# Copyright 2013-2017 Ghent University +# Copyright 2013-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/rest.py b/test/rest.py index cab451a4..b5788494 100644 --- a/test/rest.py +++ b/test/rest.py @@ -1,5 +1,5 @@ # -# Copyright 2014-2017 Ghent University +# Copyright 2014-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -71,8 +71,10 @@ def test_client(self): def test_request_methods(self): """Test all request methods""" - status, body = self.client.head() + status, headers = self.client.head() self.assertEqual(status, 200) + self.assertTrue(headers) + self.assertTrue('X-GitHub-Media-Type' in headers) try: status, body = self.client.user.emails.post(body='jens.timmerman@ugent.be') self.assertTrue(False, 'posting to unauthorized endpoint did not trhow a http error') diff --git a/test/run.py b/test/run.py index 815e7af2..20d165ec 100644 --- a/test/run.py +++ b/test/run.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2017 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/runtests/qa.py b/test/runtests/qa.py index 2f0d1bfa..9ddfbfa4 100755 --- a/test/runtests/qa.py +++ b/test/runtests/qa.py @@ -1,5 +1,5 @@ # -# Copyright 2016-2017 Ghent University +# Copyright 2016-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/runtests/simple.py b/test/runtests/simple.py index 5eafe136..26c52936 100755 --- a/test/runtests/simple.py +++ b/test/runtests/simple.py @@ -1,5 +1,5 @@ # -# Copyright 2016-2017 Ghent University +# Copyright 2016-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/runtests/simple_option.py b/test/runtests/simple_option.py index f6fe6dab..577f480c 100755 --- a/test/runtests/simple_option.py +++ b/test/runtests/simple_option.py @@ -1,5 +1,5 @@ # -# Copyright 2011-2017 Ghent University +# Copyright 2011-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/sandbox/testpkg/__init__.py b/test/sandbox/testpkg/__init__.py index bb7019a5..e8c3397c 100644 --- a/test/sandbox/testpkg/__init__.py +++ b/test/sandbox/testpkg/__init__.py @@ -1,4 +1,29 @@ # +# Copyright 2019-2019 Ghent University +# +# This file is part of vsc-base, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# the Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/hpcugent/vsc-base +# +# vsc-base is free software: you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# vsc-base is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with vsc-base. If not, see . +# +# # Copyright 2016-2017 Ghent University # # This file is part of vsc-base, diff --git a/test/sandbox/testpkg/testmodule.py b/test/sandbox/testpkg/testmodule.py index 93754668..4658ff8d 100644 --- a/test/sandbox/testpkg/testmodule.py +++ b/test/sandbox/testpkg/testmodule.py @@ -1,5 +1,5 @@ # -# Copyright 2014-2017 Ghent University +# Copyright 2014-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/sandbox/testpkg/testmodulebis.py b/test/sandbox/testpkg/testmodulebis.py index fd07b9dc..7ed2c183 100644 --- a/test/sandbox/testpkg/testmodulebis.py +++ b/test/sandbox/testpkg/testmodulebis.py @@ -1,5 +1,5 @@ # -# Copyright 2014-2017 Ghent University +# Copyright 2014-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/testing.py b/test/testing.py index 95ccc057..9910b5da 100644 --- a/test/testing.py +++ b/test/testing.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2017 Ghent University +# Copyright 2012-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/wrapper.py b/test/wrapper.py index 836561e8..4765f084 100644 --- a/test/wrapper.py +++ b/test/wrapper.py @@ -1,5 +1,5 @@ # -# Copyright 2014-2017 Ghent University +# Copyright 2014-2019 Ghent University # # This file is part of vsc-base, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),