Allow override of SSH key glob (MR 2167)

This commit is contained in:
Tony Garnock-Jones 2021-11-13 22:28:56 +01:00
parent 5d3cbbdb86
commit 3c5effa0e7
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,7 @@ config_keys = ["aports",
"nonfree_firmware", "nonfree_firmware",
"nonfree_userland", "nonfree_userland",
"ssh_keys", "ssh_keys",
"ssh_key_glob",
"timezone", "timezone",
"ui", "ui",
"ui_extras", "ui_extras",
@ -111,6 +112,7 @@ defaults = {
"nonfree_userland": False, "nonfree_userland": False,
"port_distccd": "33632", "port_distccd": "33632",
"ssh_keys": False, "ssh_keys": False,
"ssh_key_glob": "~/.ssh/id_*.pub",
"timezone": "GMT", "timezone": "GMT",
"ui": "weston", "ui": "weston",
"ui_extras": False, "ui_extras": False,

View File

@ -279,7 +279,7 @@ def copy_ssh_keys(args):
if not args.ssh_keys: if not args.ssh_keys:
return return
keys = [] keys = []
for key in glob.glob(os.path.expanduser("~/.ssh/id_*.pub")): for key in glob.glob(os.path.expanduser(args.ssh_key_glob)):
with open(key, "r") as infile: with open(key, "r") as infile:
keys += infile.readlines() keys += infile.readlines()