Skip to content

Commit 8b560e7

Browse files
takehayasarthurdev
andcommitted
T6013: Remove trusted_user_ca_key when the configuration does not exist
Co-authored-by: Simon <965089+sarthurdev@users.noreply.github.com>
1 parent 967218a commit 8b560e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/conf_mode/service_ssh.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def generate(ssh):
134134
write_file(
135135
trusted_user_ca_key, '\n'.join(encode_certificate(c) for c in ca_full_chain)
136136
)
137+
elif os.path.exists(trusted_user_ca_key):
138+
os.unlink(trusted_user_ca_key)
137139

138140
render(config_file, 'ssh/sshd_config.j2', ssh)
139141

0 commit comments

Comments
 (0)