X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fclient.py;h=a69f3ccbea1ef7d8d274b2d5b696cffd67d0ec99;hb=55d761f76934a69d22b75b633cc50c73f4651fda;hp=c7f043b6cc716ad1f7117c61bac5371c196b920b;hpb=54a2a65cf3c784ceeb41e2351140ce216a21dd4d;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/client.py b/osmclient/sol005/client.py index c7f043b..a69f3cc 100644 --- a/osmclient/sol005/client.py +++ b/osmclient/sol005/client.py @@ -40,6 +40,7 @@ from osmclient.sol005 import repo from osmclient.sol005 import osmrepo from osmclient.sol005 import subscription from osmclient.common import package_tool +from osmclient.common.exceptions import ClientException import json import logging @@ -107,7 +108,7 @@ class Client(object): self.utils = utils.Utils(http_client, **kwargs) """ - def get_token(self): + def get_token(self, pwd_change=None): self._logger.debug("") if self._token is None: postfields_dict = { @@ -129,6 +130,10 @@ class Client(object): # raise ClientException(message) token = json.loads(resp) if resp else None + if token.get("message") == "change_password" and not pwd_change: + raise ClientException( + "Password Expired. Please update the password using change_password option" + ) self._token = token["id"] if self._token is not None: