def prepare_git_user(self):
"""
Tries to read the git name and email, so all git commits have correct author.
Requests /api/user-git to check which user is behind the current configured ssh key.
"""
import aetros.api
try:
response = aetros.api.request('user-git')
if response:
user = yaml.safe_load(response)
self.git_name = user['name']
self.git_email = user['email']
else:
self.go_offline()
except ApiConnectionError as e:
self.go_offline()
评论列表
文章目录