diff options
author | Michal Minar <miminar@redhat.com> | 2013-03-22 10:30:35 +0100 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-03-22 10:30:35 +0100 |
commit | 6565f1261bf5ec326e780a2b2becbb8200c63b7c (patch) | |
tree | fdf73ef40abc1073112befb98ec55bdf1562167a | |
parent | efd5ac0f86f69e146444f199d575b3e980492fee (diff) | |
download | openlmi-providers-6565f1261bf5ec326e780a2b2becbb8200c63b7c.tar.gz openlmi-providers-6565f1261bf5ec326e780a2b2becbb8200c63b7c.tar.xz openlmi-providers-6565f1261bf5ec326e780a2b2becbb8200c63b7c.zip |
support the registration of mof files only0.0.20
openlmi-mof-register script now allows to register just the mof files
without any providers
LMI_Qualifiers.mof should be included in dependent mof files with
# pragma include ("LMI_Qualifiers.mof")
-rw-r--r-- | mof/LMI_Jobs.mof | 2 | ||||
-rw-r--r-- | mof/LMI_Qualifiers.mof | 21 | ||||
-rwxr-xr-x | openlmi-mof-register | 48 |
3 files changed, 58 insertions, 13 deletions
diff --git a/mof/LMI_Jobs.mof b/mof/LMI_Jobs.mof index ce6cb11..b17e833 100644 --- a/mof/LMI_Jobs.mof +++ b/mof/LMI_Jobs.mof @@ -20,6 +20,8 @@ * Michal Minar <miminar@redhat.com */ +#pragma include ("LMI_Qualifiers.mof") + class LMI_AffectedJobElement : CIM_AffectedJobElement { }; diff --git a/mof/LMI_Qualifiers.mof b/mof/LMI_Qualifiers.mof index 5a53ff2..d6b11ec 100644 --- a/mof/LMI_Qualifiers.mof +++ b/mof/LMI_Qualifiers.mof @@ -1,3 +1,24 @@ +/* + * Copyright (C) 2012-2013 Red Hat, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: + * Jan Safranek <jsafrane@redhat.com> + */ + /* 'Implemented' qualifier denotes the properties and method that are implemented * by appropriate OpenLMI provider. */ diff --git a/openlmi-mof-register b/openlmi-mof-register index 61e54af..e322664 100755 --- a/openlmi-mof-register +++ b/openlmi-mof-register @@ -23,17 +23,29 @@ pegasus_repository="/var/lib/Pegasus/" function usage() { - printf "Usage: $0 [ register | unregister ] <mof> [mof] [...] <reg>\n" + printf "Usage: $0 [ --just-mofs ] CMD <mof> [mof] [...] [reg] + CMD is one of [ register, unregister ] + + just-mofs option causes that all arguments after CMD will be + treated as mof files - no registration file is expected. + + usage with --just-mofs: + $0 CMD <mof> [mof] [...] + usage without: + $0 CMD <mof> [mof] [...] <reg>\n" + } function register() { - reg=$1 - shift + if [ $JUST_MOFS -eq 0 ]; then + reg=$1 + shift + fi mofs="$@" if [ $HAS_SFCBD -eq 1 ]; then - /usr/bin/sfcbstage -r "$reg" "$mofs" + /usr/bin/sfcbstage ${reg:+-r} $reg $mofs /usr/bin/sfcbrepos -f /usr/bin/systemctl reload-or-try-restart sblim-sfcb.service fi @@ -49,19 +61,23 @@ function register() fi $CIMMOF -uc $mofs - if [ -x $(dirname $0)/openlmi-register-pegasus ]; - then - cat "$reg" | $(dirname $0)/openlmi-register-pegasus | $CIMMOF -uc -n root/PG_Interop - else - cat "$reg" | /usr/libexec/openlmi-register-pegasus | $CIMMOF -uc -n root/PG_Interop + if [ $JUST_MOFS = 0 ]; then + if [ -x $(dirname $0)/openlmi-register-pegasus ]; + then + cat "$reg" | $(dirname $0)/openlmi-register-pegasus | $CIMMOF -uc -n root/PG_Interop + else + cat "$reg" | /usr/libexec/openlmi-register-pegasus | $CIMMOF -uc -n root/PG_Interop + fi fi fi } function unregister() { - reg=$1 - shift + if [ $JUST_MOFS -eq 0 ]; then + reg=$1 + shift + fi # convert mofs to `basename mof` declare -a mofs=("$@") for ((i=0; i<${#mofs[@]}; i++)); do @@ -70,12 +86,12 @@ function unregister() if [ $HAS_SFCBD -eq 1 ]; then - /usr/bin/sfcbunstage -r $(basename "$reg") ${mofs[@]} + /usr/bin/sfcbunstage ${reg:+-r} $(basename "$reg") ${mofs[@]} /usr/bin/sfcbrepos -f /usr/bin/systemctl reload-or-try-restart sblim-sfcb.service fi - if [ $HAS_PEGASUS -eq 1 ]; + if [ -n "$reg" -a $HAS_PEGASUS -eq 1 ]; then for provider in $(sed -n 's/ *location: *//p' "$reg" | sort | uniq); do @@ -106,6 +122,12 @@ fi # TODO: check if at least one server is installed +if [ "$1" = "--just-mofs" ]; then + JUST_MOFS=1 + shift +else + JUST_MOFS=0 +fi CMD=$1 shift |