diff --git a/hosting/forms.py b/hosting/forms.py index 8aff59d4..23f7b3f6 100644 --- a/hosting/forms.py +++ b/hosting/forms.py @@ -106,12 +106,6 @@ class UserHostingKeyForm(forms.ModelForm): logger.debug( "Not a correct ssh format {error}".format(error=str(cpe))) raise forms.ValidationError(KEY_ERROR_MESSAGE) - try: - os.remove(tmp_public_key_file.name) - except FileNotFoundError: - logger.debug( - "{} could not be deleted because it doesn't exist".format( - tmp_public_key_file.name)) return openssh_pubkey_str def clean_name(self): diff --git a/utils/tasks.py b/utils/tasks.py index ecad5c71..d9b40ac3 100644 --- a/utils/tasks.py +++ b/utils/tasks.py @@ -68,12 +68,6 @@ def save_ssh_key(self, hosts, keys): except Exception as cdist_exception: logger.error(cdist_exception) return_value = False - try: - os.remove(tmp_manifest.name) - except FileNotFoundError: - logger.debug( - "{} could not be deleted because it doesn't exist".format( - tmp_manifest.name)) return return_value