Xun Sun wrote:
On 1/11/06, [email protected]
<[email protected]> wrote:
linux-ha CVS committal
Author : alan
Host :
Project : linux-ha
Module : resources
Dir : linux-ha/resources/OCF
Modified Files:
Filesystem.in
Log Message:
Changed Fileystem to not log status if it's called as a monitor operation.
Also noted a bug about validate-all.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/Filesystem.in,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- Filesystem.in 20 Dec 2005 08:34:47 -0000 1.11
+++ Filesystem.in 10 Jan 2006 17:32:35 -0000 1.12
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: Filesystem.in,v 1.11 2005/12/20 08:34:47 zhenh Exp $
+# $Id: Filesystem.in,v 1.12 2006/01/10 17:32:35 alan Exp $
#
# Support: [EMAIL PROTECTED]
# License: GNU General Public License (GPL)
@@ -96,7 +96,7 @@
cat <<-EOT;
usage: $0 {start|stop|status|monitor|validate-all|meta-data}
- $Id: Filesystem.in,v 1.11 2005/12/20 08:34:47 zhenh Exp $
+ $Id: Filesystem.in,v 1.12 2006/01/10 17:32:35 alan Exp $
EOT
}
@@ -323,26 +323,35 @@
#
Filesystem_status()
{
- if [ $blockdevice = "yes" ]; then
- grep -q -e "^$DEVICE $MOUNTPOINT " /proc/mounts
- rc=$?
+ if
+ [ $blockdevice = "yes" ]
+ then
+ greppat="^$DEVICE $MOUNTPOINT "
else
- grep -q -e " $MOUNTPOINT " /proc/mounts
- rc=$?
+ greppat=" $MOUNTPOINT "
+ rc=$?
fi
+ if
+ grep -q -e "${greppat}" /proc/mounts >/dev/null 2>&1
+ then
+ rc=$OCF_SUCCESS
+ msg="$MOUNTPOINT is mounted (running)"
+ else
+ rc=$OCF_NOT_RUNNING
+ msg="$MOUNTPOINT is unmounted (stopped)"
+ fi
- if [ $rc = 0 ] ; then
- ocf_log info "$MOUNTPOINT is mounted (running)"
- return $OCF_SUCCESS
- else
- ocf_log info "$MOUNTPOINT is unmounted (stopped)"
- return $OCF_NOT_RUNNING
- fi
+ case "$OP" in
+ status) ocf_log info "$msg";;
+ esac
+ return $rc
}
# end of Filesystem_status
#
# VALIDATE_ALL: Are the instance parameters valid?
+# FIXME!! The only part that's useful is the return code.
Aren't the log messages useful at all? The reason it always returned
$OCF_SUCCESS was that I was not sure any of the unusual cases (mount
point non-existential or already in use, fs seems unsupported because
we don't detect it by too smart guess) was fatal, as discussed in
bugzilla #320.
The messages aren't useful - since this is ONLY a GUI command. The GUI
can only see the return code - because by definition, that's how this
API was designed by OCF.
And, the messages are in English, whereas the GUI is in some native
language - so they don't match up in that respect either.
--
Alan Robertson <[EMAIL PROTECTED]>
"Openness is the foundation and preservative of friendship... Let me
claim from you at all times your undisguised opinions." - William
Wilberforce
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/