Skip to content

Commit

Permalink
ceph-rbdnamer: include snapshot name if present
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Durgin <[email protected]>
  • Loading branch information
jdurgin committed Dec 6, 2011
1 parent 274f489 commit 16a211b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ceph-rbdnamer
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh

echo -n `cat /sys/devices/rbd/$1/pool`
echo -n " "
echo -n `cat /sys/devices/rbd/$1/name`
POOL=`cat /sys/devices/rbd/$1/pool`
IMAGE=`cat /sys/devices/rbd/$1/name`
SNAP=`cat /sys/devices/rbd/$1/current_snap`
if [ "$SNAP" = "-" ]; then
echo -n "$POOL $IMAGE"
else
echo -n "$POOL $IMAGE@$SNAP"
fi

0 comments on commit 16a211b

Please sign in to comment.