Created
August 5, 2015 20:26
-
-
Save jstanley23/017c60b16497a285fba7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from . import zenpacklib | |
zenpacklib.load_yaml() | |
import logging | |
from Products.ZenUtils.Utils import unused | |
from . import schema | |
log = logging.getLogger('zen.ProgressDB') | |
ZP_NAME = 'ZenPacks.Secure24.ProgressDBMonitor' | |
new_components = ( | |
'ProgressDatabase', | |
'ProgressExtent', | |
'ProgressBroker', | |
'ProgressAdminServer', | |
'ProgressNameServer', | |
) | |
MODULE_NAME = {} | |
CLASS_NAME = {} | |
for product_name in new_components: | |
MODULE_NAME[product_name] = '.'.join([ZP_NAME, product_name]) | |
CLASS_NAME[product_name] = '.'.join([ZP_NAME, product_name, product_name]) | |
class ZenPack(schema.ZenPack): | |
def install(self, app): | |
super(ZenPack, self).install(app) | |
self.ProgressEventClass(app, remove=False) | |
def remove(self, app, leaveObjects=False): | |
super(ZenPack, self).remove(app, leaveObjects=leaveObjects) | |
if not leaveObjects: | |
self.ProgressEventClass(app, remove=True) | |
def ProgressEventClass(self, app, remove=False): | |
ec = app.zport.dmd.Events.App.get('ProgressDB') | |
if not remove and not ec: | |
app.zport.dmd.Events.App.manage_addOrganizer('ProgressDB') | |
elif remove and ec: | |
app.zport.dmd.Events.App.manage_deleteOrganizer('ProgressDB') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment