Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
e3054e1b
Commit
e3054e1b
authored
Feb 25, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grf: fix list url support for gfid
parent
e7725e98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
23 deletions
+36
-23
grf
gluster/grf
+36
-23
No files found.
gluster/grf
View file @
e3054e1b
...
...
@@ -128,29 +128,7 @@ if [ -n "$sfile" ] ; then
mkdir
-p
$MOUNTDIR
mount_g
# FIXME: do not work with list
if
echo
"
$sfile
"
|
grep
"<"
;
then
echo
"Work with GFID
$sfile
path"
# Перебираем брики и находим первый попавшийся .glusterfs/AA/BB/AABBCCDDEE, преобразуем в путь и используем"
rfile
=
for
brick
in
$LISTBRICKS
;
do
set_host_path
"
$brick
"
#echo "$host - $path"
# hack: translate to a path on volume
file
=
"
$(
echo
"
$sfile
"
|
sed
-e
"s|
$FTPROOT
/||g"
)
"
rfile
=
$(
echo
$file
|
sed
-e
"s|[<>]||g"
)
rfile
=
.glusterfs/
$(
echo
$rfile
|
cut
-b1-2
)
/
$(
echo
$rfile
|
cut
-b3-4
)
/
$rfile
rpath
=
$path
rfile
=
$(
opbrick
"realpath"
"
$rfile
"
)
&&
break
done
if
[
-n
"
$rfile
"
]
;
then
sfile
=
$(
echo
$rfile
|
sed
-e
"s|.*
$rpath
|
$FTPROOT
|g"
)
else
echo
"Can't resolve this gfid"
umount_g
exit
fi
elif
echo
"
$sfile
"
|
grep
"
\*
"
;
then
if
echo
"
$sfile
"
|
grep
-q
"
\*
"
;
then
sdir
=
"
$(
dirname
"
$sfile
"
)
"
if
[
-d
"
$sdir
"
]
;
then
echo
"Work with dir
$sdir
"
...
...
@@ -165,11 +143,46 @@ else
exit
1
fi
tr_gfid_to_rpath
()
{
local
rfile rpath file
local
sfile
=
"
$1
"
rpath
=
echo
"
$sfile
"
|
grep
-q
"<"
||
return
# Перебираем брики и находим первый попавшийся .glusterfs/AA/BB/AABBCCDDEE, преобразуем в путь и используем"
rfile
=
for
brick
in
$LISTBRICKS
;
do
set_host_path
"
$brick
"
# hack: translate to a path on volume
file
=
"
$(
echo
"
$sfile
"
|
sed
-e
"s|
$FTPROOT
/||g"
)
"
rfile
=
$(
echo
$file
|
sed
-e
"s|[<>]||g"
)
rfile
=
.glusterfs/
$(
echo
$rfile
|
cut
-b1-2
)
/
$(
echo
$rfile
|
cut
-b3-4
)
/
$rfile
rpath
=
$path
rfile
=
$(
opbrick
"realpath"
"
$rfile
"
)
&&
break
done
if
[
-n
"
$rfile
"
]
;
then
# print result
echo
$rfile
|
sed
-e
"s|.*
$rpath
|
$FTPROOT
|g"
return
0
else
echo
"Can't resolve this gfid"
>
&2
return
1
fi
}
test_file
()
{
local
sfile
=
"
$1
"
if
echo
"
$sfile
"
|
grep
-q
"<"
;
then
echo
"Work with GFID
$sfile
path"
sfile
=
$(
tr_gfid_to_rpath
$sfile
)
||
return
fi
echo
echo
"mounted info for
$sfile
:"
if
[
-z
"
$restore
"
]
;
then
...
...
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