def _get_provider_auth(self):
"""Get provider authentication for the volume.
:return: string of auth method and credentials
"""
if not self.jovian_chap_auth:
return None
field = string.lowercase + string.uppercase + string.digits
chap_password = ''.join(random.sample(field,
int(self.jovian_chap_pass_len)))
if self.jovian_chap_username is not None:
return '%(auth)s %(user)s %(pass)s' % {
'auth': 'CHAP',
'user': self.jovian_chap_username,
'pass': chap_password
}
return None
评论列表
文章目录