Skip to content

Commit 1b43add

Browse files
author
root
committed
Rescue from permission errors
1 parent 1057439 commit 1b43add

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Diff for: lib/redmine_git_hosting/config/gitolite_infos.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def gitolite_infos
2121
begin
2222
RedmineGitHosting::Commands.gitolite_infos
2323
rescue RedmineGitHosting::Error::GitoliteCommandException => e
24-
logger.error('Error while getting Gitolite infos, check your SSH keys path or your Git user.')
24+
logger.error('Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.')
2525
nil
2626
end
2727
end

Diff for: lib/redmine_git_hosting/config/mirroring.rb

+10-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ def included(receiver)
2020
module ClassMethods
2121

2222
def mirroring_public_key
23-
@mirroring_public_key ||=
24-
begin
25-
format_mirror_key(gitolite_ssh_public_key_content)
26-
rescue => e
27-
logger.error("Error while loading mirroring public key : #{e.output}")
28-
nil
29-
end
23+
begin
24+
format_mirror_key(gitolite_ssh_public_key_content)
25+
rescue => e
26+
logger.error("Error while loading mirroring public key : #{e.output}")
27+
nil
28+
end
3029
end
3130

3231

@@ -60,11 +59,15 @@ def gitolite_mirroring_script
6059

6160
def gitolite_ssh_public_key_content
6261
File.read(gitolite_ssh_public_key)
62+
rescue => e
63+
nil
6364
end
6465

6566

6667
def gitolite_ssh_private_key_content
6768
File.read(gitolite_ssh_private_key)
69+
rescue => e
70+
nil
6871
end
6972

7073

0 commit comments

Comments
 (0)