def _assert_valid_stash(self):
if not self._storage.is_initialized:
raise GhostError(
'Stash not initialized. Please initialize it and try again')
else:
try:
key = self._storage.get('stored_passphrase')
if key:
self._decrypt(key['value'])
except InvalidToken:
raise GhostError(
'The passphrase provided is invalid for this stash. '
'Please provide the correct passphrase')
评论列表
文章目录