| |
@@ -203,13 +203,20 @@
|
| |
repofolder = pagure_config["GIT_FOLDER"]
|
| |
repopath = os.path.join(repofolder, project.path)
|
| |
if not os.path.exists(repopath):
|
| |
- _log.info("Git folder not found at: %s, bailing", repopath)
|
| |
+ _log.warning("Git folder not found at: %s, bailing", repopath)
|
| |
return
|
| |
|
| |
ssh_folder = pagure_config["MIRROR_SSHKEYS_FOLDER"]
|
| |
public_key_name = werkzeug.secure_filename(project.fullname)
|
| |
private_key_file = os.path.join(ssh_folder, public_key_name)
|
| |
|
| |
+ if not os.path.exists(private_key_file):
|
| |
+ _log.warning("No %s key found, bailing", private_key_file)
|
| |
+ project.mirror_hook.last_log = "Private key not found on disk, bailing"
|
| |
+ session.add(project.mirror_hook)
|
| |
+ session.commit()
|
| |
+ return
|
| |
+
|
| |
# Add the utility script allowing this feature to work on old(er) git.
|
| |
here = os.path.join(os.path.dirname(os.path.abspath(__file__)))
|
| |
script_file = os.path.join(here, "ssh_script.sh")
|
| |
If we failed generating the private key there is no point in trying
to push anything with it.
I believe this also fixes the issue we've seen with the mirroring
service as the mirroring task was failing this was impacting other
tasks while at it.
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr