summaryrefslogtreecommitdiffstats
path: root/openlmi-mof-register
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2013-07-15 15:40:22 +0200
committerJan Safranek <jsafrane@redhat.com>2013-07-17 15:21:39 +0200
commitf3cee6b1ca62752134c6c3520c3739a193753768 (patch)
treefe4308d289acd0cad012d29850d2422b59541640 /openlmi-mof-register
parentd683c446b08d2705b8bb30a45f95a1b38763e442 (diff)
downloadopenlmi-providers-f3cee6b1ca62752134c6c3520c3739a193753768.zip
openlmi-providers-f3cee6b1ca62752134c6c3520c3739a193753768.tar.gz
openlmi-providers-f3cee6b1ca62752134c6c3520c3739a193753768.tar.xz
Added -v option to openlmi-mof-register.
Diffstat (limited to 'openlmi-mof-register')
-rwxr-xr-xopenlmi-mof-register26
1 files changed, 20 insertions, 6 deletions
diff --git a/openlmi-mof-register b/openlmi-mof-register
index d327a1e..efc9df3 100755
--- a/openlmi-mof-register
+++ b/openlmi-mof-register
@@ -17,6 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# Authors: Radek Novacek <rnovacek@redhat.com>
+# Jan Safranek <jsafrane@redhat.com>
#
pegasus_repository="/var/lib/Pegasus/"
@@ -44,12 +45,15 @@ function stop_pegasus()
function usage()
{
- printf "Usage: $0 [ --just-mofs ] [ -n namespace ] [ -c cimom ]
+ printf "Usage: $0 [ --just-mofs ] [ -n namespace ] [ -c cimom ] [-v version]
CMD <mof> [mof] [...] [reg]
CMD is one of [ register, unregister ]
Default namespace is $default_namespace, which can be changed with '-n' option.
+ If a registration file is provided, '-v' parameter is mandatory and specifies
+ version of the provider API.
+
Supported cimoms are sfcbd and tog-pegasus. Without \"-c\" argument, the
operation is processed for any cimom present on system (all of them).
@@ -57,9 +61,9 @@ function usage()
treated as mof files - no registration file is expected.
usage with --just-mofs:
- $0 CMD <mof> [mof] [...]
+ $0 --just-mofs CMD <mof> [mof] [...]
usage without:
- $0 CMD <mof> [mof] [...] <reg>\n"
+ $0 -v <version> CMD <mof> [mof] [...] <reg>\n"
}
@@ -91,9 +95,9 @@ function register()
if [ $JUST_MOFS -eq 0 ]; then
if [ -x $(dirname $0)/openlmi-register-pegasus ];
then
- cat "$reg" | $(dirname $0)/openlmi-register-pegasus | $CIMMOF -uc -n root/PG_Interop
+ cat "$reg" | $(dirname $0)/openlmi-register-pegasus -v "$version" | $CIMMOF -uc -n root/PG_Interop
else
- cat "$reg" | /usr/libexec/openlmi-register-pegasus | $CIMMOF -uc -n root/PG_Interop
+ cat "$reg" | /usr/libexec/openlmi-register-pegasus -v "$version" | $CIMMOF -uc -n root/PG_Interop
fi
fi
fi
@@ -141,7 +145,7 @@ function unregister()
}
JUST_MOFS=0
-optspec=":hn:c:-:"
+optspec=":hn:c:v:-:"
while getopts "$optspec" optchar; do
case "$optchar" in
@@ -176,6 +180,9 @@ while getopts "$optspec" optchar; do
usage;
exit 0;
;;
+ v)
+ version="$OPTARG"
+ ;;
*)
if [ "$OPTERR" != 1 ] || [ "${optspec:0:1}" = ":" ]; then
echo "Non-option argument: '-${OPTARG}'" >&2
@@ -185,10 +192,17 @@ while getopts "$optspec" optchar; do
esac
done
+
shift $(($OPTIND - 1))
namespace=${namespace:-$default_namespace}
cimom=${cimom:-all}
+if [ "$JUST_MOFS" -eq 0 -a -z "$version" ]; then
+ echo "Missing -v option"
+ usage
+ exit 1
+fi
+
if [ $# -lt 2 ];
then
usage