# HG changeset patch
# User Florian Haas <[email protected]>
# Date 1246437815 -7200
# Node ID 7a6c5795122013cddbde6ca66ddd043671b26b0c
# Parent  bca917628205b84ae074794766039c57441b39e6
RA: iSCSITarget, iSCSILogicalUnit: rename instance attributes

This patch renames some resource parameters (a.k.a. supported instance
attributes) as discussed on the mailing list:

* "params" -> "additional_parameters" (so as not to conflict with the
  CRM shell's "params" keyword, and to also distinguish from other,
  named parameters that can be set via individual instance
  attributes).

* "initiators" -> "allowed_initiators" (to remove ambiguity)

diff -r bca917628205 -r 7a6c57951220 resources/OCF/iSCSILogicalUnit
--- a/resources/OCF/iSCSILogicalUnit    Wed Jul 01 10:43:35 2009 +0200
+++ b/resources/OCF/iSCSILogicalUnit    Wed Jul 01 10:43:35 2009 +0200
@@ -124,12 +124,12 @@
 <content type="string" />
 </parameter>
 
-<parameter name="params" required="0" unique="0">
+<parameter name="additional_parameters" required="0" unique="0">
 <longdesc lang="en">
-LU parameters. A space-separated list of "name=value" pairs which
-will be passed through to the iSCSI daemon's management interface. The
-supported parameters are implementation dependent. Neither the name
-nor the value may contain whitespace.
+Additional LU parameters. A space-separated list of "name=value" pairs
+which will be passed through to the iSCSI daemon's management
+interface. The supported parameters are implementation
+dependent. Neither the name nor the value may contain whitespace.
 </longdesc>
 <shortdesc lang="en">List of iSCSI LU parameters</shortdesc>
 <content type="string" />
@@ -201,7 +201,7 @@
            if [ -n "${OCF_RESKEY_scsi_sn}" ]; then
                params="${params} ScsiSN=${OCF_RESKEY_scsi_sn}"
            fi
-           params="${params} ${OCF_RESKEY_params}"
+           params="${params} ${OCF_RESKEY_additional_parameters}"
            do_cmd ietadm --op new \
                --tid=${OCF_RESKEY_tid} \
                --lun=${OCF_RESKEY_lun} \
@@ -219,7 +219,7 @@
                    params="${params} ${var}=${!envar}"
                fi
            done
-           params="${params} ${OCF_RESKEY_params}"
+           params="${params} ${OCF_RESKEY_additional_parameters}"
            do_cmd tgtadm --lld iscsi --op new --mode logicalunit \
                --tid=${OCF_RESKEY_tid} \
                --lun=${OCF_RESKEY_lun} \
diff -r bca917628205 -r 7a6c57951220 resources/OCF/iSCSITarget
--- a/resources/OCF/iSCSITarget Wed Jul 01 10:43:35 2009 +0200
+++ b/resources/OCF/iSCSITarget Wed Jul 01 10:43:35 2009 +0200
@@ -84,18 +84,7 @@
 <content type="string" />
 </parameter>
 
-<parameter name="params" required="0" unique="0">
-<longdesc lang="en">
-Target parameters. A space-separated list of "name=value" pairs which
-will be passed through to the iSCSI daemon's management interface. The
-supported parameters are implementation dependent. Neither the name
-nor the value may contain whitespace.
-</longdesc>
-<shortdesc lang="en">List of iSCSI target parameters</shortdesc>
-<content type="string" />
-</parameter>
-
-<parameter name="initiators" required="0" unique="0">
+<parameter name="allowed_initiators" required="0" unique="0">
 <longdesc lang="en">
 Allowed initiators. A space-separated list of initiators allowed to
 connect to this target. Initiators may be listed in any syntax
@@ -104,7 +93,7 @@
 </longdesc>
 <shortdesc lang="en">List of iSCSI initiators allowed to connect
 to this target</shortdesc>
-<content type="string" default="${OCF_RESKEY_initiators_default}"/>
+<content type="string" default=""/>
 </parameter>
 
 <parameter name="username" required="0" unique="0">
@@ -124,6 +113,17 @@
 <content type="string"/>
 </parameter>
 
+<parameter name="additional_parameters" required="0" unique="0">
+<longdesc lang="en">
+Additional target parameters. A space-separated list of "name=value"
+pairs which will be passed through to the iSCSI daemon's management
+interface. The supported parameters are implementation
+dependent. Neither the name nor the value may contain whitespace.
+</longdesc>
+<shortdesc lang="en">List of iSCSI target parameters</shortdesc>
+<content type="string" />
+</parameter>
+
 </parameters>
 
 <actions>
@@ -188,7 +188,7 @@
            do_cmd ietadm --op new \
                --tid=${OCF_RESKEY_tid} \
                --params Name=${OCF_RESKEY_name} || return $OCF_ERR_GENERIC
-           for param in ${OCF_RESKEY_params}; do
+           for param in ${OCF_RESKEY_additional_parameters}; do
                name=${param%=*}
                value=${param#*=}
                do_cmd ietadm --op update \
@@ -199,7 +199,7 @@
            # specifically enable access based on initiator address,
            # we must first deny access to the target globally, then
            # re-enable by specific initiator.
-           if [ -n ${OCF_RESKEY_initiators} ]; then
+           if [ -n ${OCF_RESKEY_allowed_initiators} ]; then
                echo "${OCF_RESKEY_name} ALL" >> /etc/initiators.deny
                echo "${OCF_RESKEY_name} ${OCF_RESKEY_initiators// /,}" >> 
/etc/initiators.allow
            fi
@@ -217,7 +217,7 @@
            do_cmd tgtadm --lld iscsi --op new --mode target \
                --tid=${OCF_RESKEY_tid} \
                --targetname ${OCF_RESKEY_name} || return $OCF_ERR_GENERIC
-           for param in ${OCF_RESKEY_params}; do
+           for param in ${OCF_RESKEY_additional_parameters}; do
                name=${param%=*}
                value=${param#*=}
                do_cmd tgtadm --lld iscsi --op update --mode target \
@@ -225,9 +225,10 @@
                    --name=${name} --value=${value} || return $OCF_ERR_GENERIC
            done
            # For tgt, we always have to add access per initiator;
-           # access to targets is denied by default. If "initiators"
-           # is unset, we must use the special keyword ALL.
-           for initiator in ${OCF_RESKEY_initiators=ALL}; do
+           # access to targets is denied by default. If
+           # "allowed_initiators" is unset, we must use the special
+           # keyword ALL.
+           for initiator in ${OCF_RESKEY_allowed_initiators=ALL}; do
                do_cmd tgtadm --lld iscsi --op bind --mode target \
                    --tid=${OCF_RESKEY_tid} \
                    --initiator-address=${initiator} || return $OCF_ERR_GENERIC
@@ -280,7 +281,7 @@
                fi
                do_cmd ietadm --op delete \
                    --tid=${OCF_RESKEY_tid} || return $OCF_ERR_GENERIC
-               if [ -n ${OCF_RESKEY_initiators} ]; then
+               if [ -n ${OCF_RESKEY_allowed_initiators} ]; then
                    # Avoid stale /etc/initiators.{allow,deny} entries
                    # for this target
                    do_cmd sed -e "/^${OCF_RESKEY_name}[[:space:]]/d" \
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to