Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dougsyer/3986470 to your computer and use it in GitHub Desktop.
Save dougsyer/3986470 to your computer and use it in GitHub Desktop.
# This script looks for, and fixes problems where zDeviceTemplates was
# set as a regular object attribute instead of through the acquisition
# mechanism.
from Acquisition import aq_base
for d in dmd.Devices.getSubDevices():
if hasattr(aq_base(d), 'zCollectorPlugins') and not d.hasProperty('zCollectorPlugins'):
print "%s has the problem." % d.id
templates = d.zCollectorPlugins
del(d.zCollectorPlugins)
d._setProperty('zCollectorPlugins', templates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment