diff --git a/doc/examples/icatexport.py b/doc/examples/icatexport.py index 07f7d465..43b50d35 100755 --- a/doc/examples/icatexport.py +++ b/doc/examples/icatexport.py @@ -44,7 +44,7 @@ default='USER') client, conf = config.getconfig() -if client.apiversion < '4.4': +if client.apiversion < '4.4.0': raise RuntimeError("Sorry, ICAT version %s is too old, need 4.4.0 or newer." % client.apiversion) client.login(conf.auth, conf.credentials) diff --git a/doc/examples/icatimport.py b/doc/examples/icatimport.py index bd940668..74a45cbc 100755 --- a/doc/examples/icatimport.py +++ b/doc/examples/icatimport.py @@ -44,7 +44,7 @@ default='USER') client, conf = config.getconfig() -if client.apiversion < '4.4': +if client.apiversion < '4.4.0': raise RuntimeError("Sorry, ICAT version %s is too old, need 4.4.0 or newer." % client.apiversion) client.login(conf.auth, conf.credentials) diff --git a/icat/client.py b/icat/client.py index 4635e395..9d713756 100644 --- a/icat/client.py +++ b/icat/client.py @@ -146,7 +146,7 @@ def __init__(self, url, idsurl=None, self.apiversion = Version(apiversion) log.debug("Connect to %s, ICAT version %s", url, self.apiversion) - if self.apiversion < '4.3': + if self.apiversion < '4.3.0': warn(ClientVersionWarning(self.apiversion, "too old")) self.entityInfoCache = {} self.typemap = getTypeMap(self) @@ -370,7 +370,7 @@ def getAuthenticatorInfo(self): except suds.WebFault as e: raise translateError(e) except suds.MethodNotFound as e: - if self.apiversion < '4.9': + if self.apiversion < '4.9.0': raise VersionMethodError("getAuthenticatorInfo", self.apiversion) else: diff --git a/icat/ids.py b/icat/ids.py index 9185fdcf..6f9ac452 100644 --- a/icat/ids.py +++ b/icat/ids.py @@ -271,7 +271,7 @@ def getIcatUrl(self): try: return self.opener.open(req).read().decode('ascii') except (HTTPError, IDSError) as e: - raise self._versionMethodError("getIcatUrl", '1.4', e) + raise self._versionMethodError("getIcatUrl", '1.4.0', e) def isReadOnly(self): """See if the server is configured to be readonly. @@ -344,7 +344,7 @@ def write(self, selection): try: self.opener.open(req) except (HTTPError, IDSError) as e: - raise self._versionMethodError("write", '1.9', e) + raise self._versionMethodError("write", '1.9.0', e) def reset(self, selection): """Reset data so that they can be queried again. @@ -354,7 +354,7 @@ def reset(self, selection): try: self.opener.open(req) except (HTTPError, IDSError) as e: - raise self._versionMethodError("reset", '1.6', e) + raise self._versionMethodError("reset", '1.6.0', e) def prepareData(self, selection, compressFlag=False, zipFlag=False): """Prepare data for a subsequent :meth:`~icat.ids.IDSClient.getData` @@ -388,7 +388,7 @@ def getDatafileIds(self, selection): result = self.opener.open(req).read().decode('ascii') return json.loads(result)['ids'] except (HTTPError, IDSError) as e: - raise self._versionMethodError("getDatafileIds", '1.5', e) + raise self._versionMethodError("getDatafileIds", '1.5.0', e) def getData(self, selection, compressFlag=False, zipFlag=False, outname=None, offset=0): diff --git a/icatdump.py b/icatdump.py index c6b28454..8ddd8b20 100755 --- a/icatdump.py +++ b/icatdump.py @@ -34,7 +34,7 @@ default='YAML') client, conf = config.getconfig() -if client.apiversion < '4.3': +if client.apiversion < '4.3.0': raise RuntimeError("Sorry, ICAT version %s is too old, need 4.3.0 or newer." % client.apiversion) client.login(conf.auth, conf.credentials) diff --git a/icatingest.py b/icatingest.py index 4c8cfe7b..6bd25116 100755 --- a/icatingest.py +++ b/icatingest.py @@ -51,7 +51,7 @@ "but required for uploadDatafiles.") conf.dataDir = os.path.abspath(conf.dataDir) -if client.apiversion < '4.3': +if client.apiversion < '4.3.0': raise RuntimeError("Sorry, ICAT version %s is too old, need 4.3.0 or newer." % client.apiversion) client.login(conf.auth, conf.credentials) diff --git a/tests/test_03_getversion.py b/tests/test_03_getversion.py index c113db5e..ca3eabfe 100644 --- a/tests/test_03_getversion.py +++ b/tests/test_03_getversion.py @@ -19,7 +19,7 @@ def test_get_icat_version(): # python-icat supports ICAT server 4.3 or newer. But actually, we # just want to check that client.apiversion is set and supports # comparison with version strings. - assert client.apiversion > '1.0' + assert client.apiversion > '1.0.0' print("\nConnect to %s\nICAT version %s\n" % (conf.url, client.apiversion)) diff --git a/wipeicat.py b/wipeicat.py index 5c47e8df..b0af6d19 100755 --- a/wipeicat.py +++ b/wipeicat.py @@ -18,7 +18,7 @@ config = icat.config.Config(ids="optional") client, conf = config.getconfig() -if client.apiversion < '4.3': +if client.apiversion < '4.3.0': raise RuntimeError("Sorry, icat.server version %s is too old, " "need 4.3.0 or newer." % client.apiversion) if client.ids and client.ids.apiversion < '1.6.0':