mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
chore(gpg_secretstore): avoid automatic field numbering
This commit is contained in:
parent
7df7155978
commit
531e0fec22
2 changed files with 9 additions and 9 deletions
|
@ -122,7 +122,7 @@ class SecretStore:
|
|||
self.recipient_method = "list"
|
||||
if recipient_method not in self.RECIPIENT_METHODS:
|
||||
raise NotImplementedError(
|
||||
"Recipient method {} is not supported".format(recipient_method)
|
||||
"Recipient method {0} is not supported".format(recipient_method)
|
||||
)
|
||||
|
||||
def __convert_slug_to_path(self, slug: str) -> Path:
|
||||
|
@ -178,7 +178,7 @@ class SecretStore:
|
|||
data_type = data_type.lower()
|
||||
|
||||
if data_type not in self.SUPPORTED_TYPES:
|
||||
raise NotImplementedError("Datatype %s is not supported".format(data_type))
|
||||
raise NotImplementedError("Datatype {0} is not supported".format(data_type))
|
||||
|
||||
if check_recipients:
|
||||
file_recipients = self.get_recipients_from_encrypted_file(slug)
|
||||
|
@ -234,7 +234,7 @@ class SecretStore:
|
|||
base_path = base_path.parent
|
||||
else:
|
||||
raise FileNotFoundError(
|
||||
"Could not find {} in tree".format(self.pass_gpg_id_file)
|
||||
"Could not find {0} in tree".format(self.pass_gpg_id_file)
|
||||
)
|
||||
with open(base_path / self.pass_gpg_id_file) as f:
|
||||
return f.read().splitlines()
|
||||
|
@ -246,7 +246,7 @@ class SecretStore:
|
|||
data_type = "plain"
|
||||
|
||||
if data_type not in self.SUPPORTED_TYPES:
|
||||
raise NotImplementedError("Datatype {} is not supported".format(data_type))
|
||||
raise NotImplementedError("Datatype {0} is not supported".format(data_type))
|
||||
|
||||
result = None
|
||||
if data_type == "plain":
|
||||
|
|
|
@ -252,7 +252,7 @@ class SecretGenerator:
|
|||
self.kwargs = kwargs
|
||||
if self.secret_type not in self.ALLOWED_SECRET_TYPES:
|
||||
raise NotImplementedError(
|
||||
"Secret type {} is not supported".format(secret_type)
|
||||
"Secret type {0} is not supported".format(secret_type)
|
||||
)
|
||||
|
||||
def getSecret(self):
|
||||
|
@ -263,7 +263,7 @@ class SecretGenerator:
|
|||
if self.secret_type == "user_supplied":
|
||||
return self.__userSuppliedSecret(**self.kwargs)
|
||||
raise NotImplementedError(
|
||||
"Secret type {} is not supported".format(self.secret_type)
|
||||
"Secret type {0} is not supported".format(self.secret_type)
|
||||
)
|
||||
|
||||
def getSecretData(self):
|
||||
|
@ -274,7 +274,7 @@ class SecretGenerator:
|
|||
if self.data_type == "yaml":
|
||||
return yaml.safe_load(self.getSecret())
|
||||
raise NotImplementedError(
|
||||
"Data type {} is not supported".format(self.secret_type)
|
||||
"Data type {0} is not supported".format(self.secret_type)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
@ -385,8 +385,8 @@ def main():
|
|||
secret="",
|
||||
ansible_facts={},
|
||||
diff={
|
||||
"before_header": "{} gpg recipients".format(password_slug),
|
||||
"after_header": "{} gpg recipients".format(password_slug),
|
||||
"before_header": "{0} gpg recipients".format(password_slug),
|
||||
"after_header": "{0} gpg recipients".format(password_slug),
|
||||
"before": [],
|
||||
"after": [],
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue