Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-shell
Commits
025f97aa
Commit
025f97aa
authored
May 31, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lock_file_location' into 'master'
Lock file location
parents
c26647b9
2c5d04de
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
CHANGELOG
CHANGELOG
+3
-0
lib/gitlab_keys.rb
lib/gitlab_keys.rb
+1
-1
spec/gitlab_keys_spec.rb
spec/gitlab_keys_spec.rb
+12
-1
No files found.
CHANGELOG
View file @
025f97aa
v1.9.5
- Put authorized_keys.lock in the same directory as authorized_keys
v1.9.4
- Use lock file when modify authorized_keys
...
...
lib/gitlab_keys.rb
View file @
025f97aa
...
...
@@ -92,6 +92,6 @@ class GitlabKeys
end
def
lock_file
@lock_file
||=
File
.
join
(
ROOT_PATH
,
"authorized_keys.lock"
)
@lock_file
||=
auth_file
+
'.lock'
end
end
spec/gitlab_keys_spec.rb
View file @
025f97aa
...
...
@@ -96,7 +96,10 @@ describe GitlabKeys do
end
context
"without file writing"
do
before
{
Tempfile
.
stub
(
:open
)
}
before
do
Tempfile
.
stub
(
:open
)
gitlab_keys
.
stub
(
:lock
).
and_yield
end
it
"should log an rm-key event"
do
$logger
.
should_receive
(
:info
).
with
(
'Removing key key-741'
)
...
...
@@ -146,6 +149,10 @@ describe GitlabKeys do
end
describe
:lock
do
before
do
GitlabKeys
.
any_instance
.
stub
(
lock_file:
tmp_lock_file_path
)
end
it
"should raise exception if operation lasts more then timeout"
do
key
=
GitlabKeys
.
new
expect
do
...
...
@@ -201,4 +208,8 @@ describe GitlabKeys do
def
tmp_authorized_keys_path
File
.
join
(
ROOT_PATH
,
'tmp'
,
'authorized_keys'
)
end
def
tmp_lock_file_path
tmp_authorized_keys_path
+
'.lock'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment