exit 1
}
+host_nids_address() {
+ local nodes=$1
+ local kind=$2
+
+ if [ -n "$kind" ]; then
+ nids=$(do_nodes $nodes "$LCTL list_nids | grep $kind | cut -f 1 -d '@'")
+ else
+ nids=$(do_nodes $nodes "$LCTL list_nids all | cut -f 1 -d '@'")
+ fi
+ echo $nids
+}
+
h2name_or_ip() {
if [ "$1" = "client" -o "$1" = "'*'" ]; then echo \'*\'; else
echo $1"@$2"
ostuuid_from_index()
{
- $LFS osts $2 | awk '/^'$1'/ { print $2 }'
+ $LFS osts $2 | sed -ne "/^$1: /s/.* \(.*\) .*$/\1/p"
+}
+
+ostname_from_index() {
+ local uuid=$(ostuuid_from_index $1)
+ echo ${uuid/_UUID/}
+}
+
+index_from_ostuuid()
+{
+ $LFS osts $2 | sed -ne "/${1}/s/\(.*\): .* .*$/\1/p"
}
remote_node () {
done
}
-# One client request could be timeouted because server was not ready
+# One client request could be timed out because server was not ready
# when request was sent by client.
# The request timeout calculation details :
# ptl_send_rpc ()
local maxtime=$(( 2 * $(request_timeout $facet)))
if ! do_rpc_nodes $(facet_host $facet) \
-_wait_import_state $expected $param $maxtime; then
+ _wait_import_state $expected $param $maxtime; then
error "import is not in ${expected} state"
return 1
fi
local mdtdev=$2
shift 2
local files="$@"
- local mntpt=${MOUNT%/*}/$facet
+ local mntpt=$(facet_mntpt $facet)
echo "removing files from $mdtdev on $facet: $files"
mount -t $FSTYPE $MDS_MOUNT_OPTS $mdtdev $mntpt || return $?
local mdtdev=$2
shift 2
local files="$@"
- local mntpt=${MOUNT%/*}/$facet
+ local mntpt=$(facet_mntpt $facet)
echo "duplicating files on $mdtdev on $facet: $files"
mkdir -p $mntpt || return $?