Updated Branches: refs/heads/trunk 8b36d8973 -> 21de59370
WHIRR-712. prepare_all_disks.sh should cover xvdX as well as sdX. Project: http://git-wip-us.apache.org/repos/asf/whirr/repo Commit: http://git-wip-us.apache.org/repos/asf/whirr/commit/21de5937 Tree: http://git-wip-us.apache.org/repos/asf/whirr/tree/21de5937 Diff: http://git-wip-us.apache.org/repos/asf/whirr/diff/21de5937 Branch: refs/heads/trunk Commit: 21de59370d600491abf112a9f2f6f68bf458f768 Parents: 8b36d89 Author: Andrew Bayer <andrew.ba...@gmail.com> Authored: Mon Mar 25 09:20:45 2013 -0700 Committer: Andrew Bayer <andrew.ba...@gmail.com> Committed: Wed Mar 27 15:11:37 2013 -0700 ---------------------------------------------------------------------- CHANGES.txt | 2 + .../main/resources/functions/prepare_all_disks.sh | 4 + .../src/main/resources/functions/prepare_disks.sh | 49 --------------- 3 files changed, 6 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/whirr/blob/21de5937/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 171098a..732053e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,8 @@ Release 0.8.2 (unreleased changes) IMPROVEMENTS + WHIRR-712. prepare_all_disks.sh should cover xvdX as well as sdX. (abayer) + WHIRR-711. Add security group support for OpenStack. (abayer) WHIRR-681. Enhance puppet service with an ability to export http://git-wip-us.apache.org/repos/asf/whirr/blob/21de5937/services/hadoop/src/main/resources/functions/prepare_all_disks.sh ---------------------------------------------------------------------- diff --git a/services/hadoop/src/main/resources/functions/prepare_all_disks.sh b/services/hadoop/src/main/resources/functions/prepare_all_disks.sh index d850b7a..1681cf3 100644 --- a/services/hadoop/src/main/resources/functions/prepare_all_disks.sh +++ b/services/hadoop/src/main/resources/functions/prepare_all_disks.sh @@ -51,6 +51,10 @@ function prep_disk() { device=$2 automount=${3:-false} + if [ ! -e $device ]; then + device=$(echo "$device"|sed -e 's/\/sd/\/xvd/') + fi + # is device formatted? if [ $(mountpoint -q -x $device) ]; then echo "$device is formatted" http://git-wip-us.apache.org/repos/asf/whirr/blob/21de5937/services/hadoop/src/main/resources/functions/prepare_disks.sh ---------------------------------------------------------------------- diff --git a/services/hadoop/src/main/resources/functions/prepare_disks.sh b/services/hadoop/src/main/resources/functions/prepare_disks.sh deleted file mode 100644 index 999f1f4..0000000 --- a/services/hadoop/src/main/resources/functions/prepare_disks.sh +++ /dev/null @@ -1,49 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -set -x - -# This function ensures that all the mount directories in the mapping string -# whose devices are already mounted are available to be used. Symlinks are -# created as necessary. -# -# E.g. suppose the mapping string were /data0,/dev/sdb;/data1,/dev/sdc -# and /dev/sdb were mounted on /mnt, and /dev/sdc was not mounted (possibly -# not even formatted). -# In this case a symlink would be created from /data0 to /mnt. /data1 would -# be created. -function prepare_disks() { - for mapping in $(echo "$1" | tr ";" "\n"); do - # Split on the comma (see "Parameter Expansion" in the bash man page) - mount=${mapping%,*} - device=${mapping#*,} - prep_disk $mount $device - done -} - -function prep_disk() { - mount=$1 - device=$2 - # is device mounted? - mount | grep -q $device - if [ $? == 0 ]; then - echo "$device is mounted" - if [ ! -d $mount ]; then - echo "Symlinking to $mount" - ln -s $(grep $device /proc/mounts | awk '{print $2}') $mount - fi - fi -}