]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Extending setup.py by installing SSH deploy keys
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 10 Nov 2023 12:56:23 +0000 (13:56 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 10 Nov 2023 12:56:23 +0000 (13:56 +0100)
setup.py

index 1cf7587ff5d056dda686331d352aeb87abb3d56a..e306f812b9114c23921acc4b38130d954077b992 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,7 @@ __lib_dir__ = os.path.join(__base_dir__, 'lib')
 __module_dir__ = os.path.join(__lib_dir__, 'cr_tf')
 __init_py__ = os.path.join(__module_dir__, '__init__.py')
 __postinst_scriptdir__ = pathlib.Path(__base_dir__) / 'postinstall-scripts'
+__keys_dir__ = pathlib.Path(__base_dir__) / 'keys'
 
 PATHS = {
     '__base_dir__': __base_dir__,
@@ -152,6 +153,14 @@ for f in __postinst_scriptdir__.glob('*'):
 if __pi_scripts__:
     __data_files__.append(('postinstall-scripts', __pi_scripts__))
 
+__keys__ = []
+for f in __keys_dir__.glob('*'):
+    if f.is_file() and os.access(str(f), os.R_OK):
+        relpath = os.path.relpath(str(f), __base_dir__)
+        __keys__.append(relpath)
+if __keys__:
+    __data_files__.append(('keys', __keys__))
+
 # print("Found data files:\n" + pp(__data_files__) + "\n")