File: 0021-Fix-bootstrap-bash.patch

package info (click to toggle)
crmsh 5.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,980 kB
  • sloc: python: 50,399; sh: 1,207; makefile: 255; xml: 243; exp: 234; awk: 22
file content (25 lines) | stat: -rw-r--r-- 973 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Fix bootstrap with dash
Author: Valentin Vidic <vvidic@debian.org>
Last-Update: 2024-02-17
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/crmsh/ssh_key.py
+++ b/crmsh/ssh_key.py
@@ -275,7 +275,7 @@
     ssh-keygen -t {key_type} -f ~/.ssh/id_{key_type} -q -C "Cluster internal on $(hostname)" -N '' <> /dev/null
     echo 'GENERATED=1'
 fi
-for file in ~/.ssh/id_{{{pattern}}}; do
+for file in {pattern}; do
     if [ -f "$file" ]; then
         if ! [ -f "$file".pub ]; then
             ssh-keygen -y -f "$file" > "$file".pub
@@ -286,7 +286,7 @@
 '''.format(
             condition=' -o '.join([f'-f ~/.ssh/id_{t}' for t in self.KNOWN_KEY_TYPES]),
             key_type=self.DEFAULT_KEY_TYPE,
-            pattern=','.join(self.KNOWN_KEY_TYPES),
+            pattern=' '.join([f'~/.ssh/id_{t}' for t in self.KNOWN_KEY_TYPES]),
         )
         result = self.cluster_shell.subprocess_run_without_input(
             host, user,