pre-add trigger failure doesn't prevent in-memory modifications
by Nishanth Aravamudan
Hi,
So I'm working a bit further on Autotest + Cobbler and am trying to make
it so that when a user is using Cobbler manually, that is without
Autotest, they can't accidentally setup a host in-use by Autotest for
reinstallation (and eventually power it off). Cobbler hooks provide a
nice mechanism for this, because the pre-add trigger will be invoked by
save_item (which is minimally used by the web interface for saving data,
and seems like it should be used by the CLI too, but I'm still
researching that to be 100%). However, using a dummy hook that should
prevent any data from being saved (that is, the following:
def register():
# this pure python trigger acts as if it were a legacy
# shell-trigger, but is much faster.
# the return of this method indicates the trigger type
return "/var/lib/cobbler/triggers/add/system/pre/*"
def run(api,args,logger):
if logger is not None:
logger.debug("Running trigger with args %s" % args)
return 1
) I found that the changes persisted in the web UI *until* I restarted
cobblerd, at which point they were lost. That is, I think, they are kept
in memory (possibly a cache I'm not aware of) but aren't present in the
actual database? I'm not entirely sure this is a "bug", but it certainly
seems like a usability issue -- any thoughts?
Thanks,
Nish
11 years, 2 months