#!/bin/bash # $HeadURL$ $LastChangedRevision$ # Properties MY_ID=system_hardware_vm PARENT_ID=system_hardware MY_PRIVATE_ATTRIBUTES="uname status helper" MY_PUBLIC_ATTRIBUTES= MY_ATTRIBUTES="$MY_PRIVATE_ATTRIBUTES $MY_PUBLIC_ATTRIBUTES" MY_HELPER_IDS="$(ls | fgrep -v helper | xargs echo)" # Instantiate my attributes for MY_ATTRIBUTE in ${MY_ATTRIBUTES^^}; do eval "$MY_ATTRIBUTE="; done # Defaults for the questions we ask (should only used here) # Hooks edit_prologue() { map_an_inherited_attribute_to_my_helpers } create_prologue() { map_an_inherited_attribute_to_my_helpers } delete_prologue() { map_an_inherited_attribute_to_my_helpers } list_prologue() { return 0 } map_an_inherited_attribute_to_my_helpers() { # my properties inherit MY_HELPER_IDS MY_ATTRIBUTES # my attributes inherit ${MY_ATTRIBUTES^^} # those inherited attributes i will use inherit VIRTTOOL # real local # Sanity checks [ "X$VIRTTOOL" = Xvirsh -o "X$VIRTTOOL" = "Xvirt-manager" ] || internal "VIRTTOOL: seems not to have been propogated" # Guts MY_HELPER_IDS=$VIRTTOOL return 0 }