From 3c5effa0e746fce14f7db764a4e1df5ebd0ed6de Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 13 Nov 2021 22:28:56 +0100 Subject: [PATCH] Allow override of SSH key glob (MR 2167) --- pmb/config/__init__.py | 2 ++ pmb/install/_install.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 231aff03..c3948e9e 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -70,6 +70,7 @@ config_keys = ["aports", "nonfree_firmware", "nonfree_userland", "ssh_keys", + "ssh_key_glob", "timezone", "ui", "ui_extras", @@ -111,6 +112,7 @@ defaults = { "nonfree_userland": False, "port_distccd": "33632", "ssh_keys": False, + "ssh_key_glob": "~/.ssh/id_*.pub", "timezone": "GMT", "ui": "weston", "ui_extras": False, diff --git a/pmb/install/_install.py b/pmb/install/_install.py index ff9df91d..4048cc6a 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -279,7 +279,7 @@ def copy_ssh_keys(args): if not args.ssh_keys: return 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: keys += infile.readlines()