Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
agkyra
Commits
43c875ae
Commit
43c875ae
authored
May 12, 2015
by
Giorgos Korfiatis
Browse files
fix some rename/link errors
parent
dbcb4a3d
Changes
1
Show whitespace changes
Inline
Side-by-side
agkyra/agkyra/syncer/localfs_client.py
View file @
43c875ae
...
...
@@ -52,8 +52,11 @@ def link_file(src, dest):
try
:
os
.
link
(
src
,
dest
)
except
OSError
as
e
:
if
e
.
errno
in
[
OS_FILE_EXISTS
,
OS_NOT_A_DIR
]
:
if
e
.
errno
==
OS_FILE_EXISTS
:
raise
common
.
ConflictError
(
"Cannot link, '%s' exists."
%
dest
)
if
e
.
errno
==
OS_NOT_A_DIR
:
raise
common
.
ConflictError
(
"Cannot link, missing path for '%s'."
%
dest
)
if
e
.
errno
==
OS_NO_FILE_OR_DIR
:
raise
DirMissing
()
...
...
@@ -143,7 +146,7 @@ def stat_file(path):
try
:
return
os
.
lstat
(
path
)
except
OSError
as
e
:
if
e
.
errno
==
OS_NO_FILE_OR_DIR
:
if
e
.
errno
in
[
OS_NO_FILE_OR_DIR
,
OS_NOT_A_DIR
]
:
return
None
raise
...
...
@@ -266,7 +269,7 @@ class LocalfsTargetHandle(object):
logger
.
info
(
"Hiding file '%s' to '%s'"
%
(
fspath
,
hidden_path
))
except
OSError
as
e
:
if
e
.
errno
==
OS_NO_FILE_OR_DIR
:
if
e
.
errno
in
[
OS_NO_FILE_OR_DIR
,
OS_NOT_A_DIR
]
:
self
.
unregister_hidden_name
(
hidden_filename
)
logger
.
info
(
"File '%s' does not exist"
%
fspath
)
return
...
...
@@ -391,7 +394,7 @@ class LocalfsSourceHandle(object):
try
:
os
.
rename
(
fspath
,
stage_path
)
except
OSError
as
e
:
if
e
.
errno
==
OS_NO_FILE_OR_DIR
:
if
e
.
errno
in
[
OS_NO_FILE_OR_DIR
,
OS_NOT_A_DIR
]
:
logger
.
info
(
"Source does not exist: '%s'"
%
fspath
)
self
.
unregister_stage_name
(
stage_filename
)
return
...
...
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