Prevent keyring empty strings
This commit is contained in:
parent
c7260aa993
commit
c29625cce1
@ -4,6 +4,13 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
def keyring_get_password(service_name, username):
|
||||||
|
value = ""
|
||||||
|
while value == "":
|
||||||
|
value = keyring.get_password(service_name, username)
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(description="Helper script for working with restic backups")
|
parser = argparse.ArgumentParser(description="Helper script for working with restic backups")
|
||||||
|
|
||||||
@ -15,9 +22,9 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
scw_project_id = keyring.get_password("scaleway", "access_key")
|
scw_project_id = keyring_get_password("scaleway", "access_key")
|
||||||
scw_secret_key = keyring.get_password("scaleway", "secret_key")
|
scw_secret_key = keyring_get_password("scaleway", "secret_key")
|
||||||
restic_password = keyring.get_password("restic", "password")
|
restic_password = keyring_get_password("restic", "password")
|
||||||
|
|
||||||
scw_environ = {
|
scw_environ = {
|
||||||
"AWS_ACCESS_KEY_ID": scw_project_id,
|
"AWS_ACCESS_KEY_ID": scw_project_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user