diff options
author | Jan Safranek <jsafrane@redhat.com> | 2013-07-29 13:01:31 +0200 |
---|---|---|
committer | Jan Safranek <jsafrane@redhat.com> | 2013-07-29 13:01:31 +0200 |
commit | cc31492633d833c5d5ae06a62a8303f5210c387a (patch) | |
tree | 5e03828ce73f065f01b6829986d24a22858f40b0 | |
parent | 3cfd78c405be425e75e78bf3d3f36016d3c4653d (diff) | |
download | openlmi-providers-cc31492633d833c5d5ae06a62a8303f5210c387a.tar.gz openlmi-providers-cc31492633d833c5d5ae06a62a8303f5210c387a.tar.xz openlmi-providers-cc31492633d833c5d5ae06a62a8303f5210c387a.zip |
Fixed provider deregistration if the .reg file does not have group: property.
Registration files generated by Konkret don't use 'group:' property and the
providers were not deregistered in %preun section. With this patch,
openlmi-mof-register tries to find 'group:' and fall back to 'location', if
'group' cannot be found.
-rwxr-xr-x | openlmi-mof-register | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openlmi-mof-register b/openlmi-mof-register index 0802d32..4e60e31 100755 --- a/openlmi-mof-register +++ b/openlmi-mof-register @@ -132,7 +132,12 @@ function unregister() fi if [ -n "$reg" ]; then - for provider in $(sed -n 's/ *group: *//p' "$reg" | sort | uniq); + providers=$(sed -n 's/ *group: *//p' "$reg" | sort | uniq) + if [ -z "$providers" ]; then + # fall back to location if group: is not present + providers=$(sed -n 's/ *location: *//p' "$reg" | sort | uniq) + fi + for provider in $providers; do /usr/bin/cimprovider -d -m ${provider} && /usr/bin/cimprovider -r -m ${provider} done |