From 3058c1bc970ce039a1b2822b02c070e24b35e170 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 18 2017 09:07:41 +0000 Subject: Always write the ~/.ssh/config file Otherwise we cannot clean the last entry in the file. --- diff --git a/pagure/hooks/mirror_hook.py b/pagure/hooks/mirror_hook.py index bb78a7c..9dd4e8e 100644 --- a/pagure/hooks/mirror_hook.py +++ b/pagure/hooks/mirror_hook.py @@ -175,9 +175,9 @@ def clean_ssh_config(ssh_folder, key_name, target): if ssh_config in data: data = data.replace(ssh_config, '', 1) - if data: - with open(ssh_config_file, 'w') as stream: - stream.write(data) + + with open(ssh_config_file, 'w') as stream: + stream.write(data) class MirrorTable(BASE):