Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. from keystoneauth1.identity.v3 import Password
  2. from keystoneauth1.identity.v3 import PasswordMethod
  3.  
  4. class PasswordSerialization(Password):
  5. """An extension to openstack password to allow serialization.
  6.  
  7. :param string auth_url: Identity service endpoint for authentication.
  8. :param string password: Password for authentication.
  9. :param string username: Username for authentication.
  10. :param string user_id: User ID for authentication.
  11. :param string user_domain_id: User's domain ID for authentication.
  12. :param string user_domain_name: User's domain name for authentication.
  13. :param string trust_id: Trust ID for trust scoping.
  14. :param string domain_id: Domain ID for domain scoping.
  15. :param string domain_name: Domain name for domain scoping.
  16. :param string project_id: Project ID for project scoping.
  17. :param string project_name: Project name for project scoping.
  18. :param string project_domain_id: Project's domain ID for project.
  19. :param string project_domain_name: Project's domain name for project.
  20. :param bool reauthenticate: Allow fetching a new token if the current one
  21. is going to expire. (optional) default True
  22. """
  23. _auth_method_class = PasswordMethod
  24.  
  25. #def __init__(self):
  26. # super(Password,self).__init__()
  27.  
  28. def __getstate__(self):
  29. d = dict(self.__dict__)
  30. del d['_lock']
  31. return d
  32.  
  33. def __setstate__(self, d):
  34. self.__dict__.update(d)
  35.  
  36. def __setlock__(self, lock):
  37. self._lock = lock
  38. d = dict(self.__dict__)
  39. d['_lock'] = lock
  40. self.__dict__.update(d)
  41.  
  42. def toJSON(self):
  43. return json.dumps(self, default=lambda o: o.__dict__,
  44. sort_keys=True, indent=4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement