ScriptPolicy scripts encounter LazyInitializationException on calling node.getSnmpInterface()
Description
Steps to reproduce:
1) Configure a ScriptPolicy in the default foreign-source definition, with its script attribute set to testing.groovy
2) Create OPENNMS_HOME/etc/script-policies/testing.groovy with the following contents:
3) Provision or rescan an auto-provisioned node, or rescan a requisitioned node
Expected result: Messages in provisiond.log corresponding to the LOG.warn in the script above
Actual result: Exception stack traces in provisiond.log indicating the node's SNMP interfaces failed to load:
Notably, calling node.getIpInterfaces() as is done by the script in etc/examples/script-policies/example.groovy does not cause an equivalent problem. This leads me to think the NodeDao implementation might be missing some initialization for SNMP interfaces.
Steps to reproduce:
1) Configure a ScriptPolicy in the default foreign-source definition, with its
script
attribute set totesting.groovy
2) Create
OPENNMS_HOME/etc/script-policies/testing.groovy
with the following contents:3) Provision or rescan an auto-provisioned node, or rescan a requisitioned node
Expected result:
Messages in
provisiond.log
corresponding to theLOG.warn
in the script aboveActual result:
Exception stack traces in
provisiond.log
indicating the node's SNMP interfaces failed to load:Notably, calling
node.getIpInterfaces()
as is done by the script inetc/examples/script-policies/example.groovy
does not cause an equivalent problem. This leads me to think theNodeDao
implementation might be missing some initialization for SNMP interfaces.