~rlane/nova/ldapimprovements

« back to all changes in this revision

Viewing changes to contrib/puppet/files/production/nova-iscsi-dev.sh

  • Committer: Ryan Lane
  • Date: 2010-11-24 15:46:32 UTC
  • mfrom: (382.48.1 trunk)
  • Revision ID: laner@controller-20101124154632-zh7kwjuyyd02a2lh
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# FILE: /etc/udev/scripts/iscsidev.sh
 
4
 
 
5
BUS=${1}
 
6
HOST=${BUS%%:*}
 
7
 
 
8
[ -e /sys/class/iscsi_host ] || exit 1
 
9
 
 
10
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/session*/targetname"
 
11
 
 
12
target_name=$(cat ${file})
 
13
 
 
14
# This is not an open-scsi drive
 
15
if [ -z "${target_name}" ]; then
 
16
   exit 1
 
17
fi
 
18
 
 
19
echo "${target_name##*:}"