fix: specialize error

This commit is contained in:
egarette@silique.fr 2024-12-11 21:04:08 +01:00
parent 4241cd25a7
commit 2bd04cd72d

View file

@ -22,6 +22,7 @@ from ansible.module_utils._text import to_bytes
from rougail import RougailConfig
from rougail.user_data_file import RougailUserDataFile
from rougail.error import ExtentionError
from .i18n import _
@ -43,7 +44,7 @@ class RougailUserDataAnsible(RougailUserDataFile):
rougailconfig["step.user_data"] = user_data
user_data = rougailconfig["step.user_data"]
if "ansible" not in user_data:
raise Exception(_("ansible is not set in step.user_data"))
raise ExtentionError(_("ansible is not set in step.user_data"))
self.rougailconfig = rougailconfig
self.filenames = self.rougailconfig["ansible.filename"]
self.secret = self.rougailconfig["ansible.secret"]