You can subscribe to this list here.
2007 |
Jan
|
Feb
(65) |
Mar
(276) |
Apr
(544) |
May
(638) |
Jun
(225) |
Jul
(204) |
Aug
(294) |
Sep
(532) |
Oct
(506) |
Nov
(324) |
Dec
(359) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(208) |
Feb
(225) |
Mar
(248) |
Apr
(388) |
May
(222) |
Jun
(47) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@ze...> - 2008-05-15 15:12:08
|
Author: ian Date: 2008-05-15 11:12:16 -0400 (Thu, 15 May 2008) New Revision: 9264 Modified: branches/zenoss-2.2.x/Products/ZenModel/ZenPackTemplate/setup.py Log: * Refs #3164: Backporting zenpack changes into branch Modified: branches/zenoss-2.2.x/Products/ZenModel/ZenPackTemplate/setup.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/ZenPackTemplate/setup.py 2008-05-15 15:11:45 UTC (rev 9263) +++ branches/zenoss-2.2.x/Products/ZenModel/ZenPackTemplate/setup.py 2008-05-15 15:12:16 UTC (rev 9264) @@ -48,10 +48,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss @@ -69,4 +70,4 @@ # All ZenPack eggs must be installed in unzipped form. zip_safe = False, -) \ No newline at end of file +) |
From: <sv...@ze...> - 2008-05-15 15:11:46
|
Author: ian Date: 2008-05-15 11:11:45 -0400 (Thu, 15 May 2008) New Revision: 9263 Modified: trunk/Products/ZenModel/ZenPackTemplate/setup.py Log: * Refs #3164: Changed the zenpack template to be better at file inclusion Modified: trunk/Products/ZenModel/ZenPackTemplate/setup.py =================================================================== --- trunk/Products/ZenModel/ZenPackTemplate/setup.py 2008-05-15 15:07:36 UTC (rev 9262) +++ trunk/Products/ZenModel/ZenPackTemplate/setup.py 2008-05-15 15:11:45 UTC (rev 9263) @@ -48,10 +48,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss @@ -69,4 +70,4 @@ # All ZenPack eggs must be installed in unzipped form. zip_safe = False, -) \ No newline at end of file +) |
From: <sv...@ze...> - 2008-05-15 15:07:33
|
Author: ian Date: 2008-05-15 11:07:36 -0400 (Thu, 15 May 2008) New Revision: 9262 Modified: branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py branches/zenoss-2.2.x/Products/ZenRelations/RelationshipManager.py branches/zenoss-2.2.x/Products/ZenRelations/ToOneRelationship.py branches/zenoss-2.2.x/Products/ZenUtils/ZenPackCmd.py Log: * Refs #3165: Backporting zenpack changes into branch Modified: branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-15 15:06:14 UTC (rev 9261) +++ branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-15 15:07:36 UTC (rev 9262) @@ -29,9 +29,7 @@ manage_addZenPackManager(dmd, 'ZenPackManager') for zp in dmd.packs(): zp.buildRelations() - dmd.packs._delObject(zp.id) - zp = aq_base(zp) - dmd.ZenPackManager.packs._setObject(zp.id, zp) + zp.moveObject(dmd.packs, dmd.ZenPackManager.packs) if getattr(dmd, ZENPACK_PERSISTENCE_CATALOG, None) is None: CreateZenPackPersistenceCatalog(dmd) Modified: branches/zenoss-2.2.x/Products/ZenRelations/RelationshipManager.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenRelations/RelationshipManager.py 2008-05-15 15:06:14 UTC (rev 9261) +++ branches/zenoss-2.2.x/Products/ZenRelations/RelationshipManager.py 2008-05-15 15:07:36 UTC (rev 9262) @@ -196,6 +196,17 @@ return 0 + def moveObject(self, srcRelationship, destRelationship): + """ + Move a relationship manager without deleting its relationships. + """ + self._operation = 1 + srcRelationship._delObject(self.id) + self = aq_base(self) + destRelationship._setObject(self.id, self) + return destRelationship._getOb(self.id) + + ########################################################################## # # Functions for examining a RelationshipManager's schema Modified: branches/zenoss-2.2.x/Products/ZenRelations/ToOneRelationship.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenRelations/ToOneRelationship.py 2008-05-15 15:06:14 UTC (rev 9261) +++ branches/zenoss-2.2.x/Products/ZenRelations/ToOneRelationship.py 2008-05-15 15:07:36 UTC (rev 9262) @@ -87,7 +87,9 @@ self.obj = None self.__primary_parent__._p_changed = True else: - raise ObjectNotFound + raise ObjectNotFound, "on %s: %s is not %s" % ( + self.getPrimaryId(), obj.getPrimaryId(), + self.obj.getPrimaryId()) def _remoteRemove(self, obj=None): Modified: branches/zenoss-2.2.x/Products/ZenUtils/ZenPackCmd.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenUtils/ZenPackCmd.py 2008-05-15 15:06:14 UTC (rev 9261) +++ branches/zenoss-2.2.x/Products/ZenUtils/ZenPackCmd.py 2008-05-15 15:07:36 UTC (rev 9262) @@ -336,10 +336,7 @@ if existing: for p in existing.packables(): packables.append(p) - try: - existing.packables.removeRelation(p) - except ObjectNotFound: - pass + existing.packables.removeRelation(p) if existing.isEggPack(): forceNoFileDeletion = existing.eggPath() == dist.location RemoveZenPack(dmd, existing.id, |
Author: ian Date: 2008-05-15 11:06:14 -0400 (Thu, 15 May 2008) New Revision: 9261 Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py Log: * Refs #3164: Backporting zenpack changes into branch Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -50,7 +50,8 @@ # with the binary egg. package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line @@ -69,4 +70,4 @@ # All ZenPack eggs must be installed in unzipped form. zip_safe = False, -) \ No newline at end of file +) Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -60,11 +60,13 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, + # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss # tries to put add/delete the names it manages at the beginning of this Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,11 +47,13 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { - '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + package_data = { + '': ['*.txt'], + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*','libexec/*'], + }, + # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss # tries to put add/delete the names it manages at the beginning of this Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -48,10 +48,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['datasources/*','objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py 2008-05-15 15:06:14 UTC (rev 9261) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss |
Author: ian Date: 2008-05-15 11:02:23 -0400 (Thu, 15 May 2008) New Revision: 9260 Modified: trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py Log: * Refs #3164: Included libexec in included things Modified: trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -63,7 +63,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -63,7 +63,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -63,7 +63,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -63,7 +63,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -63,7 +63,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, Modified: trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*','libexec/*'], }, Modified: trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -51,7 +51,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -63,7 +63,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line Modified: trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py 2008-05-15 14:50:02 UTC (rev 9259) +++ trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py 2008-05-15 15:02:23 UTC (rev 9260) @@ -50,7 +50,7 @@ package_data = { '': ['*.txt'], NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', - 'modeler/*/*', 'daemons/*', 'lib/*'], + 'modeler/*/*', 'daemons/*', 'lib/*', 'libexec/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line |
From: <sv...@ze...> - 2008-05-15 14:49:59
|
Author: edahl Date: 2008-05-15 10:50:02 -0400 (Thu, 15 May 2008) New Revision: 9259 Modified: trunk/Products/ZenModel/migrate/makeZenPackManager.py trunk/Products/ZenRelations/RelationshipManager.py trunk/Products/ZenRelations/ToOneRelationship.py trunk/Products/ZenUtils/ZenPackCmd.py Log: Fix problem with makeZenPackManager migrate script. Modified: trunk/Products/ZenModel/migrate/makeZenPackManager.py =================================================================== --- trunk/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-15 14:30:30 UTC (rev 9258) +++ trunk/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-15 14:50:02 UTC (rev 9259) @@ -29,9 +29,7 @@ manage_addZenPackManager(dmd, 'ZenPackManager') for zp in dmd.packs(): zp.buildRelations() - dmd.packs._delObject(zp.id) - zp = aq_base(zp) - dmd.ZenPackManager.packs._setObject(zp.id, zp) + zp.moveObject(dmd.packs, dmd.ZenPackManager.packs) if getattr(dmd, ZENPACK_PERSISTENCE_CATALOG, None) is None: CreateZenPackPersistenceCatalog(dmd) Modified: trunk/Products/ZenRelations/RelationshipManager.py =================================================================== --- trunk/Products/ZenRelations/RelationshipManager.py 2008-05-15 14:30:30 UTC (rev 9258) +++ trunk/Products/ZenRelations/RelationshipManager.py 2008-05-15 14:50:02 UTC (rev 9259) @@ -196,6 +196,17 @@ return 0 + def moveObject(self, srcRelationship, destRelationship): + """ + Move a relationship manager without deleting its relationships. + """ + self._operation = 1 + srcRelationship._delObject(self.id) + self = aq_base(self) + destRelationship._setObject(self.id, self) + return destRelationship._getOb(self.id) + + ########################################################################## # # Functions for examining a RelationshipManager's schema Modified: trunk/Products/ZenRelations/ToOneRelationship.py =================================================================== --- trunk/Products/ZenRelations/ToOneRelationship.py 2008-05-15 14:30:30 UTC (rev 9258) +++ trunk/Products/ZenRelations/ToOneRelationship.py 2008-05-15 14:50:02 UTC (rev 9259) @@ -87,7 +87,9 @@ self.obj = None self.__primary_parent__._p_changed = True else: - raise ObjectNotFound + raise ObjectNotFound, "on %s: %s is not %s" % ( + self.getPrimaryId(), obj.getPrimaryId(), + self.obj.getPrimaryId()) def _remoteRemove(self, obj=None): Modified: trunk/Products/ZenUtils/ZenPackCmd.py =================================================================== --- trunk/Products/ZenUtils/ZenPackCmd.py 2008-05-15 14:30:30 UTC (rev 9258) +++ trunk/Products/ZenUtils/ZenPackCmd.py 2008-05-15 14:50:02 UTC (rev 9259) @@ -336,10 +336,7 @@ if existing: for p in existing.packables(): packables.append(p) - try: - existing.packables.removeRelation(p) - except ObjectNotFound: - pass + existing.packables.removeRelation(p) if existing.isEggPack(): forceNoFileDeletion = existing.eggPath() == dist.location RemoveZenPack(dmd, existing.id, |
Author: ian Date: 2008-05-15 10:30:30 -0400 (Thu, 15 May 2008) New Revision: 9258 Modified: trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py Log: * Fixes #3164: Caused zenpacks to include all non-python files Modified: trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.ApacheMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.DellMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.DigMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.DnsMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.FtpMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.HPMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -50,7 +50,8 @@ # with the binary egg. package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], }, # Indicate dependencies on other python modules or ZenPacks. This line @@ -69,4 +70,4 @@ # All ZenPack eggs must be installed in unzipped form. zip_safe = False, -) \ No newline at end of file +) Modified: trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.HttpMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -60,11 +60,13 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, + # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss # tries to put add/delete the names it manages at the beginning of this Modified: trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.IRCDMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,11 +47,13 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { - '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + package_data = { + '': ['*.txt'], + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, + # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss # tries to put add/delete the names it manages at the beginning of this Modified: trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.JabberMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -48,10 +48,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['datasources/*','objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.MySqlMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -60,10 +60,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.NtpMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss Modified: trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py 2008-05-15 11:56:58 UTC (rev 9257) +++ trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/setup.py 2008-05-15 14:30:30 UTC (rev 9258) @@ -47,10 +47,11 @@ # Tell setuptools what non-python files should also be included # with the binary egg. - package_data = { + package_data = { '': ['*.txt'], - NAME: ['objects/*','skins/%s/*' % NAME], - }, + NAME: ['objects/*','skins/*/*','services/*', 'reports/*/*', + 'modeler/*/*', 'daemons/*', 'lib/*'], + }, # Indicate dependencies on other python modules or ZenPacks. This line # is modified by zenoss when the ZenPack edit page is submitted. Zenoss |
From: <sv...@ze...> - 2008-05-15 11:57:06
|
Author: ecn Date: 2008-05-15 07:56:58 -0400 (Thu, 15 May 2008) New Revision: 9257 Modified: trunk/pynetsnmp/tableretriever.py Log: * ensure that the table scanner stops at the end of table data - suggestion by popoludnica at gmail: As "startswith" can match x.10.1 at the same time as x.1.1, obviously. And as we are matching oid of a table a dot at the end won't harm, but may help. Modified: trunk/pynetsnmp/tableretriever.py =================================================================== --- trunk/pynetsnmp/tableretriever.py 2008-05-15 10:30:21 UTC (rev 9256) +++ trunk/pynetsnmp/tableretriever.py 2008-05-15 11:56:58 UTC (rev 9257) @@ -57,8 +57,9 @@ def saveResults(self, values, ts): if values: + stem = ts.startOid + '.' for oid, value in sorted(values.items()): - if oid.startswith(ts.startOid) and oid > ts.startOid: + if oid.startswith(stem) and oid > ts.startOid: ts.result.append( (oid, value) ) else: ts.finished = True |
From: <sv...@ze...> - 2008-05-15 10:30:12
|
Author: ian Date: 2008-05-15 06:30:21 -0400 (Thu, 15 May 2008) New Revision: 9256 Added: tags/zenoss-2.2.0/ Log: * Sliding tag again Copied: tags/zenoss-2.2.0 (from rev 9255, branches/zenoss-2.2.x) |
From: <sv...@ze...> - 2008-05-15 10:29:27
|
Author: ian Date: 2008-05-15 06:29:35 -0400 (Thu, 15 May 2008) New Revision: 9255 Removed: tags/zenoss-2.2.0/ Log: * Removing in preparation for new tag |
From: <sv...@ze...> - 2008-05-15 10:26:10
|
Author: ian Date: 2008-05-15 06:26:18 -0400 (Thu, 15 May 2008) New Revision: 9254 Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py Log: * Refs #3163: Backported changes into 2.2.x branch Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py 2008-05-15 03:34:25 UTC (rev 9253) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py 2008-05-15 10:26:18 UTC (rev 9254) @@ -27,7 +27,7 @@ # Default type sourcetype = 'HelloWorld' - ZENPACKID = 'HelloWorldZenPack' + ZENPACKID = 'ZenPacks.zenoss.HelloWorldZenPack' ultimateQuestion = 'Answer is 42' Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py 2008-05-15 03:34:25 UTC (rev 9253) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py 2008-05-15 10:26:18 UTC (rev 9254) @@ -19,7 +19,8 @@ class LDAPMonitorDataSource(ZenPackPersistence, RRDDataSource.RRDDataSource): LDAP_MONITOR = 'LDAPMonitor' - + ZENPACKID = 'ZenPacks.zenoss.LDAPMonitor' + sourcetypes = (LDAP_MONITOR,) sourcetype = LDAP_MONITOR Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py 2008-05-15 03:34:25 UTC (rev 9253) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py 2008-05-15 10:26:18 UTC (rev 9254) @@ -20,6 +20,7 @@ class NNTPMonitorDataSource(ZenPackPersistence, RRDDataSource.RRDDataSource): NNTP_MONITOR = 'NNTPMonitor' + ZENPACKID = 'ZenPacks.zenoss.NNTPMonitor' sourcetypes = (NNTP_MONITOR,) sourcetype = NNTP_MONITOR Modified: branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py =================================================================== --- branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py 2008-05-15 03:34:25 UTC (rev 9253) +++ branches/zenoss-2.2.x/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py 2008-05-15 10:26:18 UTC (rev 9254) @@ -20,7 +20,8 @@ class RPCMonitorDataSource(ZenPackPersistence, RRDDataSource.RRDDataSource): RPC_MONITOR = 'RPCMonitor' - + ZENPACKID = 'ZenPacks.zenoss.RPCMonitor' + sourcetypes = (RPC_MONITOR,) sourcetype = RPC_MONITOR |
Author: rak Date: 2008-05-14 23:34:25 -0400 (Wed, 14 May 2008) New Revision: 9253 Added: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/BaseClient.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/WmiClient.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/TemplateContainer.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/addeventmenuitem.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/removeWinModelerGraphPoints.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/runcommandspermission.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/winmodelerUnderModeler.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/tests/testRRDTemplates.py Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/ApplyDataMap.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/CollectorClient.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/DeviceProxy.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PortscanClient.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PythonClient.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/SnmpClient.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/plugins/CollectorPlugin.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/tests/ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zendisc.py sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zenmodeler.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Availability.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/EventManagerBase.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Schedule.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/SyslogProcessing.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/UpdateCheck.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/actionRuleWindowDetail.pt sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/editEventViews.pt sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassInstStatus.pt sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/tests/sendSyslog.py sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/zensyslog.py sandboxen/rak/zenoss-core/trunk/Products/ZenHub/PBDaemon.py sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/CommandConfig.py sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/DiscoverService.py sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PerformanceConfig.py sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PingConfig.py sandboxen/rak/zenoss-core/trunk/Products/ZenHub/tests/testRRDImpl.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Commandable.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DataRoot.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Device.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceClass.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceOrganizer.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/GraphGroup.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/LinkManager.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/MonitorClass.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/RRDDataSource.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/RRDTemplate.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/RRDView.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/TemperatureSensor.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/UserSettings.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/WinService.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZVersion.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZenPack.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZenPackManager.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZenPackPersistence.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZenPackTemplate/setup.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZenossSecurity.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/ZentinelPortal.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/__init__.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/data/devices.xml sandboxen/rak/zenoss-core/trunk/Products/ZenModel/data/events.xml sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/__init__.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/addMonitorColumn.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/fixOldTemplates.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/makeZenPackManager.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/migrate/zZenDiscLove.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/Dashboard.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/deviceListMacro.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/dialog_deleteDevice.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/editCollection.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/ipServiceClassStatus.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/ipServiceDetail.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/osProcessClassStatus.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/serviceClassStatus.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/userCommandsMacros.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/viewZenPacks.pt sandboxen/rak/zenoss-core/trunk/Products/ZenModel/skins/zenmodel/zenrrdzoom.js sandboxen/rak/zenoss-core/trunk/Products/ZenModel/tests/testLinking.py sandboxen/rak/zenoss-core/trunk/Products/ZenModel/tests/testWinService.py sandboxen/rak/zenoss-core/trunk/Products/ZenRRD/zenperfsnmp.py sandboxen/rak/zenoss-core/trunk/Products/ZenRRD/zenrender.py sandboxen/rak/zenoss-core/trunk/Products/ZenRelations/checkrel.py sandboxen/rak/zenoss-core/trunk/Products/ZenReports/ReportMail.py sandboxen/rak/zenoss-core/trunk/Products/ZenReports/reports/Device_Reports/All_Monitored_Components.rpt sandboxen/rak/zenoss-core/trunk/Products/ZenReports/reports/Performance_Reports/Filesystem_Util_Report.rpt sandboxen/rak/zenoss-core/trunk/Products/ZenStatus/zenping.py sandboxen/rak/zenoss-core/trunk/Products/ZenUITests/tests/selenium/SelTestBase.py sandboxen/rak/zenoss-core/trunk/Products/ZenUITests/tests/selenium/TestDeviceInstance.py sandboxen/rak/zenoss-core/trunk/Products/ZenUITests/tests/selenium/TestMonitors.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/CmdBase.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/EggifyZenPack.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/Skins.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/ZCmdBase.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/ZenBackup.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/ZenBackupBase.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/ZenPackCmd.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/ZenRestore.py sandboxen/rak/zenoss-core/trunk/Products/ZenUtils/zenpack.py sandboxen/rak/zenoss-core/trunk/Products/ZenWidgets/skins/zenui/dialog_removeDevices.pt sandboxen/rak/zenoss-core/trunk/Products/ZenWidgets/skins/zenui/javascript/devicezengrid.js sandboxen/rak/zenoss-core/trunk/Products/ZenWidgets/skins/zenui/javascript/portlet.js sandboxen/rak/zenoss-core/trunk/Products/ZenWidgets/skins/zenui/javascript/zengrid.js sandboxen/rak/zenoss-core/trunk/Products/ZenWidgets/skins/zenui/javascript/zenoss-core.js sandboxen/rak/zenoss-core/trunk/Products/ZenWin/WinCollector.py sandboxen/rak/zenoss-core/trunk/Products/ZenWin/zeneventlog.py sandboxen/rak/zenoss-core/trunk/Products/ZenWin/zenwin.py sandboxen/rak/zenoss-core/trunk/Products/ZenWin/zenwinmodeler.py Log: merge 5/14/08 snapshot Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/ApplyDataMap.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/ApplyDataMap.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/ApplyDataMap.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -228,6 +228,8 @@ except UnicodeEncodeError: decoding = obj.zCollectorDecoding value = value.decode(decoding) + except UnicodeDecodeError: + continue if attname[0] == '_': continue att = getattr(aq_base(obj), attname, zenmarker) if att == zenmarker: Copied: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/BaseClient.py (from rev 9252, sandboxen/rak/zenoss-core/vendor/curent/Products/DataCollector/BaseClient.py) Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/CollectorClient.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/CollectorClient.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/CollectorClient.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -34,13 +34,16 @@ from twisted.internet import protocol -class CollectorClient(protocol.ClientFactory): +from BaseClient import BaseClient + +class CollectorClient(BaseClient, protocol.ClientFactory): maintainConnection = False cmdindex = 0 def __init__(self, hostname, ip, port, plugins=None, options=None, device=None, datacollector=None, alog=None): + BaseClient.__init__(self, device, datacollector) from Products.ZenUtils.Utils import unused unused(alog) self.hostname = hostname @@ -52,10 +55,8 @@ for plugin in plugins: self.cmdmap[plugin.command] = plugin self._commands.append(plugin.command) - self.device = device self.results = [] self.protocol = None - self.datacollector = datacollector if options: defaultUsername = options.username Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/DeviceProxy.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/DeviceProxy.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/DeviceProxy.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -24,7 +24,7 @@ return DateTime(float(self._snmpLastCollection)) def getSnmpStatus(self): - return self._snmpStatus + return getattr(self, '_snmpStatus', 0) getSnmpStatusNumber = getSnmpStatus def getId(self): Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PortscanClient.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PortscanClient.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PortscanClient.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -22,14 +22,15 @@ log = logging.getLogger("zen.PortscanClient") -class PortscanClient(object): +from BaseClient import BaseClient +class PortscanClient(BaseClient): + def __init__(self, hostname, ipaddr, options=None, device=None, datacollector=None, plugins=[]): + BaseClient.__init__(self, device, datacollector) self.hostname = hostname - self.device = device self.options = options - self.datacollector = datacollector self.plugins = plugins self.results = [] Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PythonClient.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PythonClient.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/PythonClient.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -16,12 +16,13 @@ import Globals -class PythonClient(object): +from BaseClient import BaseClient +class PythonClient(BaseClient): + def __init__(self, device=None, datacollector=None, plugins=[]): - self.device = device + BaseClient.__init__(self, device, datacollector) self.hostname = device.id - self.datacollector = datacollector self.plugins = plugins self.results = [] Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/SnmpClient.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/SnmpClient.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/SnmpClient.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -31,10 +31,13 @@ DEFAULT_MAX_OIDS_BACK = 40 -class SnmpClient(object): +from BaseClient import BaseClient +class SnmpClient(BaseClient): + def __init__(self, hostname, ipaddr, options=None, device=None, datacollector=None, plugins=[]): + BaseClient.__init__(self, device, datacollector) global defaultTries, defaultTimeout self.hostname = hostname self.device = device @@ -85,7 +88,7 @@ def doRun(self, driver): # test snmp connectivity log.debug("Testing SNMP configuration") - yield self.proxy.walk('.1') + yield self.proxy.walk('.1.3') try: driver.next() except TimeoutError, ex: Copied: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/WmiClient.py (from rev 9252, sandboxen/rak/zenoss-core/vendor/curent/Products/DataCollector/WmiClient.py) Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/plugins/CollectorPlugin.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/plugins/CollectorPlugin.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/plugins/CollectorPlugin.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -37,6 +37,8 @@ deviceProperties = ('id', 'manageIp', '_snmpLastCollection', + '_snmpStatus', + 'zCollectorClientTimeout', ) isip = iputil.isip Property changes on: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/tests ___________________________________________________________________ Name: svn:ignore + *.pyc Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zendisc.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zendisc.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zendisc.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -19,7 +19,9 @@ from Products.ZenUtils.Utils import unused from Products.ZenUtils.Driver import drive from Products.ZenUtils.IpUtil import asyncNameLookup +from Products.ZenUtils.IpUtil import isip from Products.ZenUtils.NJobs import NJobs +from Products.ZenModel.Exceptions import NoIPAddress from Products.ZenEvents.ZenEventClasses import Status_Snmp from Products.ZenEvents.Event import Info from Products.ZenStatus.AsyncPing import Ping @@ -42,9 +44,8 @@ name = 'zendisc' scanned = 0 - def __init__(self,noopts=0,app=None,single=True, - threaded=False,keeproot=True): - ZenModeler.__init__(self, noopts, app, single, threaded, keeproot) + def __init__(self,noopts=0,app=None,single=True, keeproot=True): + ZenModeler.__init__(self, noopts, app, single, keeproot) if not self.options.useFileDescriptor: self.openPrivilegedPort('--ping') self.discovered = [] @@ -195,6 +196,7 @@ return drive(inner) + def discoverDevice(self, ip, devicepath="/Discovered", prodState=1000): """Discover a device based on its ip address. """ @@ -272,6 +274,10 @@ def collectNet(self, driver): + import types + # net option from the config file is a string + if type(self.options.net) in types.StringTypes: + self.options.net = [self.options.net] # in case someone uses 10.0.0.0,192.168.0.1 instead of # --net 10.0.0.0 --net 192.168.0.1 if isinstance(self.options.net, list) and \ @@ -319,6 +325,33 @@ self.log.info("Result: %s", results) self.main() + def createDevice(self, driver): + """ + Add a device to the system by name or ip. + """ + deviceName = self.options.device + self.log.info("Looking for %s" % deviceName) + ip = None + if isip(deviceName): + ip = deviceName + else: + try: + ip = socket.gethostbyname(deviceName) + except socket.error: + ip = "" + if not ip: + raise NoIPAddress("No IP found for name %s" % deviceName) + else: + self.log.info("Found IP %s for device %s" % (ip, deviceName)) + yield self.config().callRemote('getDeviceConfig', [deviceName]) + me, = driver.next() or [None] + if not me or self.options.remodel: + yield self.discoverDevice(ip, + devicepath=self.options.deviceclass, + prodState=self.options.productionState) + yield succeed("Discovered device.") + driver.next() + def walkDiscovery(self, driver): myname = socket.getfqdn() self.log.info("my hostname = %s", myname) @@ -361,37 +394,39 @@ self.log.info('connected to ZenHub') if self.options.walk: d = drive(self.walkDiscovery) + elif self.options.device: + d = drive(self.createDevice) else: d = drive(self.collectNet) d.addBoth(self.printResults) def autoAllocate(self, device=None): - """Execute a script that will auto allocate devices into their - Device Classes""" - self.log.debug("trying to auto-allocate device %s" % device.id ) - if not device: - return + """Execute a script that will auto allocate devices into their + Device Classes""" + self.log.debug("trying to auto-allocate device %s" % device.id ) + if not device: + return + script = getattr(device, "zAutoAllocateScript", None) + self.log.debug("no auto-allocation script found") + if script: + import string + script = string.join(script, "\n") + self.log.debug("using script\n%s" % script) + try: + compile(script, "zAutoAllocateScript", "exec") + except: + self.log.error("zAutoAllocateScript contains error") + return + vars = {'dev': device, 'log': self.log} + try: + exec(script, vars) + except: + self.log.error( + "error executing zAutoAllocateScript:\n%s" % script) + return vars.get('devicePath', None) + return - script = getattr(device, "zAutoAllocateScript", None) - self.log.debug("no auto-allocation script found") - if script: - import string - script = string.join(script, "\n") - self.log.debug("using script\n%s" % script) - try: - compile(script, "zAutoAllocateScript", "exec") - except: - self.log.error("zAutoAllocateScript contains error") - return - vars = {'dev': device, 'log': self.log} - try: - exec(script, vars) - except: - self.log.error("error executing zAutoAllocateScript:\n%s" % script) - return vars.get('devicePath', None) - return - def buildOptions(self): ZenModeler.buildOptions(self) self.parser.add_option('--net', dest='net', action="append", @@ -435,7 +470,7 @@ dest='useFileDescriptor', default=None, help="Use the given (priveleged) file descriptor for ping") - self.parser.add_option('--auto-allocate', dest='autoAllocate', + self.parser.add_option('--assign-devclass-script', dest='autoAllocate', action="store_true", default=False, help="have zendisc auto allocate devices after discovery") self.parser.add_option('--walk', dest='walk', action='store_true', Modified: sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zenmodeler.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zenmodeler.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/DataCollector/zenmodeler.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -30,6 +30,7 @@ import TelnetClient import SnmpClient import PortscanClient +import WmiClient defaultPortScanTimeout = 5 defaultParallel = 1 @@ -51,8 +52,7 @@ generateEvents = True configCycleInterval = 360 - def __init__(self,noopts=0,app=None,single=False, - threaded=None,keeproot=False): + def __init__(self, noopts=0, app=None, single=False, keeproot=False): PBDaemon.__init__(self) # FIXME: cleanup --force option #2660 self.options.force = True @@ -73,9 +73,6 @@ self.single = single if self.options.device: self.single = True - self.threaded = threaded - if self.threaded is None: - self.threaded = not self.options.nothread self.modelerCycleInterval = self.options.cycletime self.collage = self.options.collage / 1440.0 self.clients = [] @@ -157,11 +154,35 @@ clientTimeout = getattr(device, 'zCollectorClientTimeout', 180) ip = device.manageIp timeout = clientTimeout + time.time() + self.wmiCollect(device, ip, timeout) self.pythonCollect(device, ip, timeout) self.cmdCollect(device, ip, timeout) self.snmpCollect(device, ip, timeout) self.portscanCollect(device, ip, timeout) + def wmiCollect(self, device, ip, timeout): + "Start the wmi collector" + if self.options.nowmi: + return + client = None + try: + plugins = self.selectPlugins(device, 'wmi') + if not plugins: + self.log.info("no wmi plugins found for %s" % device.id) + return + if self.checkCollection(device): + self.log.info('wmi collection device %s' % device.id) + self.log.info("plugins: %s", + ", ".join(map(lambda p: p.name(), plugins))) + client = WmiClient.WmiClient(device, self) + if not client or not plugins: + self.log.warn("wmi client creation failed") + return + except (SystemExit, KeyboardInterrupt): + raise + except Exception: + self.log.exception("error opening wmi client") + self.addClient(client, timeout, 'wmi', device.id) def pythonCollect(self, device, ip, timeout): """Start local collection client. @@ -435,9 +456,9 @@ self.parser.add_option('--debug', dest='debug', action="store_true", default=False, help="don't fork threads for processing") - self.parser.add_option('--nothread', - dest='nothread', action="store_true", default=True, - help="do not use threads when applying updates") + self.parser.add_option('--nowmi', + dest='nowmi', action="store_true", default=False, + help="do not run zenwinmodeler to execute WMI plugins") self.parser.add_option('--parallel', dest='parallel', type='int', default=defaultParallel, help="number of devices to collect from in parallel") @@ -491,6 +512,7 @@ self.log.warn("client %s timeout", client.hostname) self.finished.append(client) client.timedOut = True + client.stop() else: active.append(client) self.clients = active Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Availability.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Availability.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Availability.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -122,6 +122,7 @@ w += ' AND firstTime <= %(endDate)s ' w += ' AND firstTime != lastTime ' w += " AND eventClass = '%(eventClass)s' " + w += " AND prodState >= 1000 " if self.device: w += " AND device = '%(device)s' " if self.component: @@ -153,8 +154,11 @@ finally: zem.close(conn) total = endDate - startDate if self.device: - deviceList = [dmd.Devices.findDevice(self.device)] - devices.setdefault( (self.device, self.component), 0) + deviceList = [] + device = dmd.Devices.findDevice(self.device) + if device: + deviceList = [device] + devices.setdefault( (self.device, self.component), 0) else: deviceList = [d for d in dmd.Devices.getSubDevices()] if not self.component: Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/EventManagerBase.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/EventManagerBase.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/EventManagerBase.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -1681,14 +1681,12 @@ ''' if status < 0: src = 'grey' - elif status == 0: - src = 'green' - elif status == 1: - src = 'yellow' - elif status == 2: - src = 'yellow' else: - src = 'red' + colors = "green yellow orange red".split() + try: + src = colors[status] + except IndexError: + src = 'red' return '/zport/dmd/img/%s_dot.png' % src @@ -1873,6 +1871,9 @@ don't want to test the combination. This is an option during device deletion. It is also used by zenactions to keep history table clean. + + NB: Device.deleteDevice() is not currently calling this when devices + are deleted. See ticket #2996. """ import subprocess import os Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Schedule.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Schedule.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/Schedule.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -57,8 +57,17 @@ def getWindows(self): result = [] catalog = getattr(self.dmd, 'maintenanceWindowSearch', None) - if catalog: - result.extend(x.getObject() for x in catalog()) + if catalog is not None: + for brain in catalog(): + try: + ob = brain.getObject() + except KeyError: + # We're just catching the symptom for now, but an actual + # fix will be forthcoming. + # http://dev.zenoss.org/trac/ticket/3105 + pass + else: + result.append(ob) else: # Should be removed in 2.3. self.log.warn('Run zenmigrate to index your maintenance windows.') for dev in self.dmd.Devices.getSubDevices(): Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/SyslogProcessing.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/SyslogProcessing.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/SyslogProcessing.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -45,13 +45,16 @@ r"device_id=\S+\s+\[\S+\](?P<eventClassKey>\S+\d+):\s+(?P<summary>.*)\s+\((?P<originalTime>\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)\)", # unix syslog with pid -r"(?P<component>\S+)\[(?P<pid>\d+)\]: (?P<summary>.*)", +r"(?P<component>\S+)\[(?P<pid>\d+)\]:\s*(?P<summary>.*)", # unix syslog without pid r"(?P<component>\S+): (?P<summary>.*)", # adtran devices -r"^(?P<deviceModel>[^\[]+)\[(?P<deviceManufacturer>ADTRAN)\]:(?P<component>[^\|]+\|\d+\|\d+)\|(?P<summary>.*)" +r"^(?P<deviceModel>[^\[]+)\[(?P<deviceManufacturer>ADTRAN)\]:(?P<component>[^\|]+\|\d+\|\d+)\|(?P<summary>.*)", + +# proprietary message passing system +r"^(?P<component>\S+)(\.|\s)[A-Z]{3} \d \S+ \d\d:\d\d:\d\d-\d\d:\d\d:\d\d \d{5} \d{2} \d{5} \S+ \d{4} \d{3,5} (- )*(?P<summary>.*) \d{4} \d{4}", ) # compile regex parsers on load @@ -62,10 +65,11 @@ class SyslogProcessor(object): - def __init__(self, sendEvent, minpriority, parsehost, defaultPriority): + def __init__(self,sendEvent,minpriority,parsehost,monitor,defaultPriority): self.minpriority = minpriority self.parsehost = parsehost self.sendEvent = sendEvent + self.monitor = monitor self.defaultPriority = defaultPriority @@ -85,7 +89,7 @@ evt = self.parseTag(evt, msg) #rest of msg now in summary of event evt = self.buildEventClassKey(evt) - evt['monitor'] = self.options.monitor + evt['monitor'] = self.monitor self.sendEvent(evt) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/UpdateCheck.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/UpdateCheck.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/UpdateCheck.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -37,9 +37,19 @@ class UpdateCheck: - def getUpdate(self, dmd, manual): + def getUpdate(self, dmd, manual, product=None): + """ + Send a GET request to dev.zenoss.org giving some parameters about this + Zenoss installation and getting back the version number for the + most recent product release. The product can be passed in the product + parameter, but if product is None then the code will attempt to + figure out which product is currently running and use that. + """ + if not product: + product = dmd.getProductName() available = None args = {} + args['pr'] = product if dmd.uuid is None: import commands dmd.uuid = commands.getoutput('uuidgen') @@ -74,7 +84,7 @@ args['nl'] = dmd.Locations.countChildren() query = urllib.urlencode(args.items()) - for line in urllib.urlopen(URL + '?' + query): + for line in urllib.urlopen(URL + '?' + query): # skip blank lines and http gunk if line.strip() and line[0] not in '<' + string.whitespace: try: Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/actionRuleWindowDetail.pt =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/actionRuleWindowDetail.pt 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/actionRuleWindowDetail.pt 2008-05-15 03:34:25 UTC (rev 9253) @@ -89,9 +89,6 @@ tal:content="e" tal:attributes="value e; selected python:e==here.repeat"/> </select> - every - <input class="tablevalues" name="skip" - tal:attributes="value here/skip" size="5"/> </td> </tr> <tr> Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/editEventViews.pt =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/editEventViews.pt 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/editEventViews.pt 2008-05-15 03:34:25 UTC (rev 9253) @@ -51,8 +51,37 @@ here)" tal:content="view/getId"/> <td class="tablevalues" tal:content="view/type"/> - <td class="tablevalues"> - <table class=" zentable" border=0 cellpadding=0 cellspacing=1 + <td class="tablevalues" width="300"> +<tal:block metal:define-macro="horizontal"> +<tal:block tal:define=" + zem python:view.ZenEventManager; + colors python:'red orange yellow blue grey green'.split(); + summaries python:view.getEventSummary(); + totals python:[x[2] for x in summaries]; + ackstatus python:[x[2]-x[1] for x in summaries]; + "> + <div class="horizontal-rainbow" + onclick="location.href=YAHOO.zenoss.templateFreeURL+'/viewEvents'"> + <tal:block tal:repeat="evnum python:totals[:-1]"> + <div tal:define="color python:colors[repeat['evnum'].index]" + tal:attributes="class string:evpill-${color}" + style="float:left"> + <span tal:content="evnum">0</span> + <div tal:condition="python:ackstatus[repeat['evnum'].index]<=0"> + </div> + </div> + </tal:block> + <div class="evpill-green" style="float:left"> + <div tal:condition="python:filter(lambda x:x, + map(int, totals[:-1]))"> + </div> + </div> + </div> +</tal:block> +</tal:block> + + <!-- + <table class=" zentable" border=0 cellpadding=0 cellspacing=1 metal:define-macro="eventrainbow" tal:on-error="structure string: <span class='errorvalues'>Events unavailable</span>"> @@ -64,7 +93,7 @@ </td> </tr> </table> - +--> </td> </tr> </tal:block> Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassInstStatus.pt =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassInstStatus.pt 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassInstStatus.pt 2008-05-15 03:34:25 UTC (rev 9253) @@ -24,7 +24,7 @@ <tr> <td class="tableheader">Events</td> <td class="tablevalues"> - <table metal:use-macro="here/rainbows/macros/eventrainbow"></table> + <table metal:use-macro="here/rainbows/macros/horizontal"></table> </td> <th class="tableheader" align="left">Total Event Count</th> <td class="tablevalues" align="center" tal:content="here/getStatus"> Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/skins/zenevents/eventClassStatus.pt 2008-05-15 03:34:25 UTC (rev 9253) @@ -12,7 +12,7 @@ <tr> <td class="tableheader" align="left">Events</td> <td class="tablevalues" align="left"> - <table metal:use-macro="here/rainbows/macros/eventrainbow" /> + <table metal:use-macro="here/rainbows/macros/horizontal" /> </td> <th class="tableheader" align="left">SubClass Count</th> <td class="tablevalues" tal:content="here/countChildren">100</td> Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/tests/sendSyslog.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/tests/sendSyslog.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/tests/sendSyslog.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -18,4 +18,4 @@ m = '''<165>%s localhost myproc[10]: %%%% It's time to make the do-nuts. %%%% Ingredients: Mix=OK, Jelly=OK # Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: Conveyer1=OK, Conveyer2=OK # %%%%''' % now now = time.strftime('%b %d %T') m = '''<165>%s foo@win2003 myproc[10]: %%%% It's time to make the do-nuts. %%%% Ingredients: Mix=OK, Jelly=OK # Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport: Conveyer1=OK, Conveyer2=OK # %%%%''' % now -s.sendto(m, ('192.168.1.102', 514) ) +s.sendto(m, ('127.0.0.1', 514) ) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/zensyslog.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/zensyslog.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenEvents/zensyslog.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -132,6 +132,7 @@ self.processor = SyslogProcessor(self.sendEvent, self.options.minpriority, self.options.parsehost, + self.options.monitor, driver.next()) self.log.info("Configuration finished") return drive(inner) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenHub/PBDaemon.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenHub/PBDaemon.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenHub/PBDaemon.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -23,9 +23,11 @@ from Products.ZenUtils.PBUtil import ReconnectingPBClientFactory from Products.ZenUtils.DaemonStats import DaemonStats +from twisted.cred import credentials from twisted.internet import reactor, defer +from twisted.internet.error import ConnectionLost from twisted.internet.defer import TimeoutError -from twisted.cred import credentials +from twisted.python.failure import Failure from twisted.spread import pb class RemoteException(Exception, pb.Copyable, pb.RemoteCopy): @@ -136,7 +138,7 @@ def getServiceNow(self, svcName): if not self.services.has_key(svcName): - self.log.error('getServiceNow returning FakeRemote for %s' % svcName) + self.log.warning('No service %s named: ZenHub may be disconnected' % svcName) return self.services.get(svcName, None) or FakeRemote() @@ -194,13 +196,11 @@ self.connected() return result def errback(error): - from twisted.python.failure import Failure if (isinstance(error, Failure) and \ isinstance(error.value, TimeoutError)): self.log.error('Timeout connecting to zenhub: is it running?') else: self.log.error('Unable to connect to zenhub: \n%s' % error) - self.stop() d.addCallbacks(callback, errback) reactor.run() self.log.info('%s shutting down' % self.name) @@ -253,7 +253,10 @@ # event service we should just log events that don't get sent # and then drop them. if reactor.running: - self.log.error('Error sending event: %s' % error) + # don't complain if you get disconnected: you'll reconnect + if not (isinstance(error, Failure) and + isinstance(error.value, ConnectionLost)): + self.log.error('Error sending event: %s' % error) self.eventQueue.append(event) if event: self.eventQueue.append(event) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/CommandConfig.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/CommandConfig.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/CommandConfig.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -37,7 +37,7 @@ cmd = Cmd() cmd.useSsh = getattr(ds, 'usessh', False) cmd.cycleTime = ds.cycletime - cmd.component = ds.component + cmd.component = ds.getComponent(comp) cmd.eventClass = ds.eventClass cmd.eventKey = key cmd.severity = ds.severity Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/DiscoverService.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/DiscoverService.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/DiscoverService.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -125,7 +125,6 @@ self.dmd.ZenEventManager.sendEvent(evt) - @translateError def remote_createDevice(self, ip, **kw): """Create a device. @@ -135,7 +134,7 @@ """ if not isip(ip): ip = socket.gethostbyname(ip) - ipobj = self.dmd.Networks.findIp(ip) + ipobj = self.dmd.Networks.createIp(ip) if not ipobj and not getattr(ipobj, "zAutoDiscover", True): # self.log.info("ip '%s' on no auto-discover, skipping",ip) return Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PerformanceConfig.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PerformanceConfig.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PerformanceConfig.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -85,7 +85,7 @@ elif self.zSnmpAuthType: cmdLineArgs += ['-l', 'authNoPriv'] else: - cmdLineArgs += ['-l', 'authNoAuthNoPriv'] + cmdLineArgs += ['-l', 'noAuthNoPriv'] if self.zSnmpAuthType: cmdLineArgs += ['-a', self.zSnmpAuthType] cmdLineArgs += ['-A', self.zSnmpAuthPassword] Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PingConfig.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PingConfig.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenHub/services/PingConfig.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -15,6 +15,7 @@ from Products.ZenHub.services.PerformanceConfig import PerformanceConfig from Products.ZenHub.HubService import threaded from Products.ZenHub.PBDaemon import translateError +from Products.ZenUtils.ZCmdBase import login class PingConfig(PerformanceConfig): "Support zenping configuration loading" @@ -25,6 +26,8 @@ conn = self.dmd._p_jar._db.open() try: dmd = conn.root()['Application'].zport.dmd + user = login(dmd, 'admin') + assert user.has_permission('View', dmd) return self.getPingTree(dmd, root, fallbackIp) finally: import transaction @@ -34,7 +37,7 @@ def getPingTree(self, dmd, root, fallbackIp): me = dmd.Devices.findDevice(root) if not me: - me = self.lookupByIp(fallbackIp) + me = self.lookupByIp(dmd, fallbackIp) if me: self.log.info("building pingtree from %s", me.id) tree = pingtree.buildTree(me) @@ -45,15 +48,20 @@ tree = pingtree.PingTree(fallbackIp) tree.root = pingtree.RouterNode(fallbackIp, root, 0) tree.root.addNet(tree, "default", "default") - devices = self.config.getPingDevices() + config = dmd.Monitors.Performance._getOb(self.instance) + devices = config.getPingDevices() self.prepDevices(tree, devices) return tree.root - def lookupByIp(self, fallbackIp): + def getDeviceConfig(self, device): + return device + + + def lookupByIp(self, dmd, fallbackIp): """Try to find the root device by our IP """ - ip = self.dmd.Networks.findIp(fallbackIp) + ip = dmd.Networks.findIp(fallbackIp) if ip and ip.device(): return ip.device() @@ -65,4 +73,4 @@ pingtree.addDevice(device) def sendDeviceConfig(self, listener, config): - listener.callRemote('updateConfig') + return listener.callRemote('updateConfig') Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenHub/tests/testRRDImpl.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenHub/tests/testRRDImpl.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenHub/tests/testRRDImpl.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -28,7 +28,7 @@ from Products.ZenHub.services.RRDImpl import RRDImpl from Products.ZenModel.Device import manage_createDevice d = manage_createDevice(self.dmd, - deviceName='127.0.0.10', + deviceName='127.0.0.1', devicePath='/Test') from Products.ZenModel.RRDTemplate import manage_addRRDTemplate manage_addRRDTemplate(self.dmd.Devices.Test.rrdTemplates, 'Device') Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Commandable.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Commandable.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Commandable.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -93,7 +93,7 @@ return self.redirectToUserCommands(REQUEST) - security.declareProtected(ZEN_CHANGE_DEVICE, 'manage_doUserCommand') + security.declareProtected(ZEN_RUN_COMMANDS, 'manage_doUserCommand') def manage_doUserCommand(self, commandId=None, REQUEST=None): ''' Execute a UserCommand. If REQUEST then wrap output in proper zenoss html page. @@ -261,8 +261,14 @@ ''' # Looks like firefox renders progressive output more smoothly # if each line is stuck into a table row. + + # I doubt the above statement, as tested on Firefox 3 + # this only generates a larger DOM object and does nothing + # for smoothness. It actually slows things down for large command + # output. Should maybe retested especially now that we are + # using CSS pre startLine = '<tr><td class="commandoutput">' - endLine = '</td></tr>\n' + endLine = '\n</td></tr>\n' if out: if not isinstance(lines, list): lines = [lines] @@ -273,5 +279,7 @@ l = cgi.escape(l) l = l.replace('\n', endLine + startLine) out.write(startLine + l + endLine) + + InitializeClass(Commandable) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DataRoot.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DataRoot.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DataRoot.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -690,4 +690,14 @@ return self.callZenScreen(REQUEST) + def getProductName(self): + """ + Return a string that represents the Zenoss product that is installed. + Currently this is something like 'core' or 'enterprise'. This is + used in the version check code to retrieve the available version + for the correct product. + """ + return getattr(self, 'productName', 'core') + + InitializeClass(DataRoot) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Device.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Device.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenModel/Device.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -37,7 +37,6 @@ from DateTime import DateTime from ZODB.POSException import POSError -from ZenossSecurity import * #from Products.SnmpCollector.SnmpCollector import findSnmpCommunity from Products.DataCollector.ApplyDataMap import ApplyDataMap @@ -172,7 +171,8 @@ communities.extend(getattr(devroot, "zSnmpCommunities", [])) if not port: port = getattr(devroot, "zSnmpPort", 161) versions = ('v2c', 'v1') - if version: versions = (version) + if not version: version = getattr(devroot, 'zSnmpVer', None) + if version: versions = (version,) timeout = getattr(devroot, "zSnmpTimeout", 2) retries = getattr(devroot, "zSnmpTries", 2) session = SnmpSession(ip, timeout=timeout, port=port, retries=retries) @@ -270,6 +270,9 @@ "managedObject")), ('userCommands', ToManyCont(ToOne, 'Products.ZenModel.UserCommand', 'commandable')), + # unused: + ('monitors', ToMany(ToMany, 'Products.ZenModel.StatusMonitorConf', + 'devices')), ) # Screen action bindings (and tab definitions) @@ -1600,14 +1603,18 @@ """ Delete device from the database + NB: deleteHistory is disabled for the 2.2 release. In some + circumstances it was causing many subprocesses to be spawned + and creating a gridlock situation. + @permission: ZEN_ADMIN_DEVICE """ parent = self.getPrimaryParent() if deleteStatus: self.getEventManager().manage_deleteHeartbeat(self.getId()) self.getEventManager().manage_deleteAllEvents(self.getId()) - if deleteHistory: - self.getEventManager().manage_deleteHistoricalEvents(self.getId()) + # if deleteHistory: + # self.getEventManager().manage_deleteHistoricalEvents(self.getId()) if deletePerf: self.getPerformanceServer().deleteRRDFiles(self.id) parent._delObject(self.getId()) @@ -1971,6 +1978,6 @@ adm = ApplyDataMap() return adm._applyDataMap(self, relmap) - - + + InitializeClass(Device) Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceClass.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceClass.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceClass.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -45,6 +45,7 @@ import RRDTemplate from DeviceOrganizer import DeviceOrganizer from ZenPackable import ZenPackable +from TemplateContainer import TemplateContainer _marker = "__MARKER___" @@ -59,7 +60,7 @@ addDeviceClass = DTMLFile('dtml/addDeviceClass',globals()) -class DeviceClass(DeviceOrganizer, ZenPackable): +class DeviceClass(DeviceOrganizer, ZenPackable, TemplateContainer): """ DeviceClass is a device organizer that manages the primary classification of device objects within the zenoss system. It manages properties @@ -84,9 +85,9 @@ default_catalog = 'deviceSearch' - _relations = DeviceOrganizer._relations + ZenPackable._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + \ + TemplateContainer._relations + ( ("devices", ToManyCont(ToOne,"Products.ZenModel.Device","deviceClass")), - ("rrdTemplates", ToManyCont(ToOne,"Products.ZenModel.RRDTemplate","deviceClass")), ) # Screen action bindings (and tab definitions) @@ -371,11 +372,11 @@ def jsonGetDeviceNames(self, query=''): ''' Return a list of all device names that match the filter. ''' - def cmpDevice(a, b): - return cmp(a.id, b.id) - devices = self.searchDevices(query) - devices.sort(cmpDevice) - return simplejson.dumps([d.id for d in devices]) + brains = self.deviceSearch.evalAdvancedQuery( + MatchGlob('id', query.rstrip('*') + '*')) + deviceIds = [b.id for b in brains] + deviceIds.sort(lambda x, y: cmp(x.lower(), y.lower())) + return simplejson.dumps(deviceIds) security.declareProtected('View', 'jsonGetComponentPaths') Modified: sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceOrganizer.py =================================================================== --- sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceOrganizer.py 2008-05-15 03:00:36 UTC (rev 9252) +++ sandboxen/rak/zenoss-core/trunk/Products/ZenModel/DeviceOrganizer.py 2008-05-15 03:34:25 UTC (rev 9253) @@ -12,6 +12,7 @@ ########################################################################### from itertools import ifilter +from types import StringTypes from AccessControl import ClassSecurityInfo from Globals import InitializeClass @@ -236,39 +237,64 @@ return self.dmd.Devices.moveDevices(moveTarget, deviceNames, REQUEST) - def setProdState(self, state, deviceNames=None, - isOrganizer=False, REQUEST=None): - """Set production state of all devices in this Organizer. - """ + def _handleOrganizerCall(self, arg=None, deviceNames=None, \ + isOrganizer=False, REQUEST=None, \ + deviceMethod=None): + """ Handle the many many methods that simply call one + method on device differently""" + #check to see if we have the essentials to work with + if not deviceMethod: return if deviceNames is None and not isOrganizer: if REQUEST: REQUEST['message'] = "No Devices Selected" return self.callZenScreen(REQUEST) for dev in self._buildDeviceList(deviceNames): - dev.setProdState(state) + devMethod = getattr(dev, deviceMethod, None) + if devMethod and arg: + devMethod(arg) + elif devMethod: + devMethod() + + + def _buildReturnMessage(self, REQUEST, message, paths=None, \ + checkPaths=False): + """build the standard return message for the various set + methods""" + if checkPaths: + if paths: + if type(paths) not in StringTypes: + paths = ", ".join(paths) + message += paths + else: + message = "%s unset" % message.split(" ")[0] + + if REQUEST.has_key('oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'): + return message + else: + return self.callZenScreen(REQUEST) + + + def setProdState(self, state, deviceNames=None, + isOrganizer=False, REQUEST=None): + """Set production state of all devices in this Organizer. + """ + self._handleOrganizerCall(state, deviceNames, isOrganizer, \ + REQUEST, "setProdState") if REQUEST: statename = self.convertProdState(state) - REQUEST['message'] = "Production State set to %s" % statename - if REQUEST.has_key('oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'): - return REQUEST['message'] - else: - return self.callZenScreen(REQUEST) - + msg = "Production State set to %s" % statename + return self._buildReturnMessage(REQUEST, msg) + + def setPriority(self, priority, deviceNames=None, isOrganizer=False, REQUEST=None): """Set prioirty of all devices in this Organizer. """ - if deviceNames is None and not isOrganizer: - if REQUEST: REQUEST['message'] = "No Devices Selected" - return self.callZenScreen(REQUEST) - for dev in self._buildDeviceList(deviceNames): - dev.setPriority(priority) + self._handleOrganizerCall(priority, deviceNames, isOrganizer, \ + REQUEST, "setPriority") if REQUEST: priname = self.convertPriority(priority) - REQUEST['message'] = "Priority set to %s" % priname - if REQUEST.has_key('oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'): - return REQUEST['message'] - else: - return self.callZenScreen(REQUEST) + msg = "Priority set to %s" % priname + return self._buildReturnMessage(REQUEST, msg) def setPerformanceMonitor(self, performanceMonitor=None, deviceNames=None, @@ -277,121 +303,68 @@ if not performanceMonitor: if REQUEST: REQUEST['message'] = "No Monitor Selected" return self.callZenScreen(REQUEST) - if deviceNames is None and not isOrganizer: - if REQUEST: REQUEST['message'] = "No Devices Selected" - return self.callZenScreen(REQUEST) - for dev in self._buildDeviceList(deviceNames): - dev.setPerformanceMonitor(performanceMonitor) + self._handleOrganizerCall(performanceMonitor, deviceNames, isOrganizer, \ + REQUEST, "setPerformanceMonitor") if REQUEST: - REQUEST['message'] = "Performance monitor set to %s" % ( - performanceMonitor) - if REQUEST.has_key('oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'): - return REQUEST['message'] - else: - return self.callZenScreen(REQUEST) - + msg = "Collector set to %s" % (performanceMonitor) + return self._buildReturnMessage(REQUEST, msg) + def setGroups(self, groupPaths=None, deviceNames=None, isOrganizer=False, REQUEST=None): """ Provide a method to set device groups from any organizer """ - if deviceNames is None and not isOrganizer: - if REQUEST: REQUEST['message'] = "No Devices Selected" - return self.callZenScreen(REQUEST) if not groupPaths: groupPaths = [] - for dev in self._buildDeviceList(deviceNames): - dev.setGroups(groupPaths) + self._handleOrganizerCall(groupPaths, deviceNames, isOrganizer, \ + REQUEST, "setGroups") if REQUEST: - if len(groupPaths) == 1: - REQUEST['message'] = "Groups set to %s" % groupPaths - elif len(groupPaths) > 1: - REQUEST['message'] = "Groups set to %s" % ", ".join(groupPaths) - else: - REQUEST['message'] = "Groups unset" - if REQUEST.has_key('oneKeyValueSoInstanceIsntEmptyAndEvalToFalse'): - return REQUEST['message'] - else: - return self.callZenScreen(REQUEST) + msg = "Groups set to" + return self._buildReturnMessage(REQUEST, msg, groupPaths, True) def setSystems(self, systemPaths=None, deviceNames=None, isOrganizer=False, REQUEST=None): """ Provide a method to set device systems from any organizer """ - if deviceNames is None and not isOrganizer: - if REQUEST: REQUEST['message'] = "No Devices Selected" - return self.callZenScreen(REQUEST) if not systemPaths: systemPaths = [] - for dev in self._buildDeviceList(deviceNames): - dev.setSystems(systemPaths) + self._handleOrganizerCall(systemPaths, deviceNames, isOrganizer, \ + REQUEST, "setSystems") if REQUEST: - if len(systemPaths) == 1: - REQUEST['message'] = "Systems set to %s" % systemPaths - elif len(systemPaths) > 1: - REQUEST['m... [truncated message content] |
From: <sv...@ze...> - 2008-05-15 03:00:30
|
Author: rak Date: 2008-05-14 23:00:36 -0400 (Wed, 14 May 2008) New Revision: 9252 Added: sandboxen/rak/zenoss-core/vendor/curent/ Log: trunk snapshot for 5/14/08 Copied: sandboxen/rak/zenoss-core/vendor/curent (from rev 9251, trunk) |
From: <sv...@ze...> - 2008-05-14 23:23:57
|
Author: jstevens Date: 2008-05-14 19:24:05 -0400 (Wed, 14 May 2008) New Revision: 9251 Modified: trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py Log: fixes #3163 Modified: trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py 2008-05-14 21:09:48 UTC (rev 9250) +++ trunk/zenpacks/ZenPacks.zenoss.HelloWorldZenPack/ZenPacks/zenoss/HelloWorldZenPack/datasources/HelloWorldDataSource.py 2008-05-14 23:24:05 UTC (rev 9251) @@ -27,7 +27,7 @@ # Default type sourcetype = 'HelloWorld' - ZENPACKID = 'HelloWorldZenPack' + ZENPACKID = 'ZenPacks.zenoss.HelloWorldZenPack' ultimateQuestion = 'Answer is 42' Modified: trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py 2008-05-14 21:09:48 UTC (rev 9250) +++ trunk/zenpacks/ZenPacks.zenoss.LDAPMonitor/ZenPacks/zenoss/LDAPMonitor/datasources/LDAPMonitorDataSource.py 2008-05-14 23:24:05 UTC (rev 9251) @@ -19,7 +19,8 @@ class LDAPMonitorDataSource(ZenPackPersistence, RRDDataSource.RRDDataSource): LDAP_MONITOR = 'LDAPMonitor' - + ZENPACKID = 'ZenPacks.zenoss.LDAPMonitor' + sourcetypes = (LDAP_MONITOR,) sourcetype = LDAP_MONITOR Modified: trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py 2008-05-14 21:09:48 UTC (rev 9250) +++ trunk/zenpacks/ZenPacks.zenoss.NNTPMonitor/ZenPacks/zenoss/NNTPMonitor/datasources/NNTPMonitorDataSource.py 2008-05-14 23:24:05 UTC (rev 9251) @@ -20,6 +20,7 @@ class NNTPMonitorDataSource(ZenPackPersistence, RRDDataSource.RRDDataSource): NNTP_MONITOR = 'NNTPMonitor' + ZENPACKID = 'ZenPacks.zenoss.NNTPMonitor' sourcetypes = (NNTP_MONITOR,) sourcetype = NNTP_MONITOR Modified: trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py =================================================================== --- trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py 2008-05-14 21:09:48 UTC (rev 9250) +++ trunk/zenpacks/ZenPacks.zenoss.RPCMonitor/ZenPacks/zenoss/RPCMonitor/datasources/RPCMonitorDataSource.py 2008-05-14 23:24:05 UTC (rev 9251) @@ -20,7 +20,8 @@ class RPCMonitorDataSource(ZenPackPersistence, RRDDataSource.RRDDataSource): RPC_MONITOR = 'RPCMonitor' - + ZENPACKID = 'ZenPacks.zenoss.RPCMonitor' + sourcetypes = (RPC_MONITOR,) sourcetype = RPC_MONITOR |
From: <sv...@ze...> - 2008-05-14 21:09:40
|
Author: ian Date: 2008-05-14 17:09:48 -0400 (Wed, 14 May 2008) New Revision: 9250 Added: tags/zenoss-2.2.0/ Log: * Sliding the 2.2.0 tag Copied: tags/zenoss-2.2.0 (from rev 9249, branches/zenoss-2.2.x) |
From: <sv...@ze...> - 2008-05-14 21:09:05
|
Author: ian Date: 2008-05-14 17:09:12 -0400 (Wed, 14 May 2008) New Revision: 9249 Removed: tags/zenoss-2.2.0/ Log: * ONE LAST TIME WE HOPE dropping the tag for a new one |
From: <sv...@ze...> - 2008-05-14 21:08:28
|
Author: ian Date: 2008-05-14 17:08:34 -0400 (Wed, 14 May 2008) New Revision: 9248 Modified: branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py Log: * Refs #3162: Backported to branch Modified: branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-14 21:07:27 UTC (rev 9247) +++ branches/zenoss-2.2.x/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-14 21:08:34 UTC (rev 9248) @@ -28,6 +28,7 @@ if not getattr(dmd, 'ZenPackManager', None): manage_addZenPackManager(dmd, 'ZenPackManager') for zp in dmd.packs(): + zp.buildRelations() dmd.packs._delObject(zp.id) zp = aq_base(zp) dmd.ZenPackManager.packs._setObject(zp.id, zp) |
From: <sv...@ze...> - 2008-05-14 21:07:22
|
Author: edahl Date: 2008-05-14 17:07:27 -0400 (Wed, 14 May 2008) New Revision: 9247 Modified: trunk/Products/ZenModel/migrate/makeZenPackManager.py Log: * fixes #3162 Modified: trunk/Products/ZenModel/migrate/makeZenPackManager.py =================================================================== --- trunk/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-14 20:52:25 UTC (rev 9246) +++ trunk/Products/ZenModel/migrate/makeZenPackManager.py 2008-05-14 21:07:27 UTC (rev 9247) @@ -28,6 +28,7 @@ if not getattr(dmd, 'ZenPackManager', None): manage_addZenPackManager(dmd, 'ZenPackManager') for zp in dmd.packs(): + zp.buildRelations() dmd.packs._delObject(zp.id) zp = aq_base(zp) dmd.ZenPackManager.packs._setObject(zp.id, zp) |
From: <sv...@ze...> - 2008-05-14 20:57:05
|
Author: jstevens Date: 2008-05-14 15:34:45 -0400 (Wed, 14 May 2008) New Revision: 9236 Modified: trunk/Products/ZenModel/__init__.py Log: * Adding the full list of class files from ZenModel to the list in __init__.py Modified: trunk/Products/ZenModel/__init__.py =================================================================== --- trunk/Products/ZenModel/__init__.py 2008-05-14 19:22:15 UTC (rev 9235) +++ trunk/Products/ZenModel/__init__.py 2008-05-14 19:34:45 UTC (rev 9236) @@ -41,81 +41,145 @@ confmon_globals = globals() productNames = ( - "Collection", - "CollectionItem", - "Classifier", - "ClassifierEntry", - "CPU", - "DataRoot", - "Device", - "DeviceClass", - "DeviceGroup", - "DeviceHW", - "DeviceReport", - "ExpansionCard", - "MultiGraphReport", + 'AdministrativeRole', + 'AdministrativeRoleable', + 'AreaGraphPoint', + 'BasicDataSource', + 'BasicDeviceLoader', + 'BatchDeviceLoader', + 'BuiltInDS', + 'CPU', + 'CdefGraphPoint', + 'CiscoLoader', + 'Classifier', + 'ClassifierEntry', + 'Collection', + 'CollectionItem', + 'Commandable', + 'CommentGraphPoint', + 'ComplexGraphPoint', + 'ConfigurationError', + 'ConfmonPropManager', + 'CustomDeviceReportClass', + 'DataPointGraphPoint', + 'DataRoot', + 'DefGraphPoint', + 'Device', + 'DeviceClass', + 'DeviceComponent', + 'DeviceGroup', + 'DeviceHW', + 'DeviceManagerBase', + 'DeviceOrganizer', + 'DeviceReport', + 'DeviceReportClass', + 'DeviceResultInt', + 'DmdBuilder', + 'EventView', + 'Exceptions', + 'ExpansionCard', + 'Fan', + 'FileSystem', + 'GprintGraphPoint', + 'GraphDefinition', + 'GraphGroup', + 'GraphPoint', + 'GraphReport', + 'GraphReportClass', + 'GraphReportElement', + 'HWComponent', + 'HardDisk', + 'Hardware', + 'HardwareClass', + 'HruleGraphPoint', + 'IpAddress', + 'IpInterface', + 'IpNetwork', + 'IpRouteEntry', + 'IpService', + 'IpServiceClass', + 'IpServiceLoader', + 'LineGraphPoint', + 'Link', + 'LinkManager', + 'Linkable', + 'Location', + 'Lockable', + 'MEProduct', + 'MaintenanceWindow', + 'MaintenanceWindowable', + 'ManagedEntity', + 'Manufacturer', + 'ManufacturerRoot', + 'MibBase', + 'MibModule', + 'MibNode', + 'MibNotification', + 'MibOrganizer', + 'MinMaxThreshold', + 'Monitor', + 'MonitorClass', + 'MultiGraphReport', 'MultiGraphReportClass', - "FileSystem", - "GraphGroup", - "GraphReport", - "GraphReportElement", - "HardDisk", - "Hardware", - "HardwareClass", - "IpAddress", - "IpInterface", - "IpNetwork", - "IpRouteEntry", - "IpService", - "IpServiceClass", - "Location", - "Manufacturer", - "ManufacturerRoot", - "MEProduct", - "MibModule", - "MibNode", - "MibNotification", - "MibOrganizer", - "MonitorClass", - "OperatingSystem", - "OSProcess", - "OSProcessClass", - "OSProcessOrganizer", - "ProductClass", - "Report", - "ReportClass", - "RRDDataSource", - "RRDDataPoint", - "RRDGraph", - "RRDTemplate", - "GraphDefinition", - "GraphPoint", - "DataPointGraphPoint", - "ThresholdGraphPoint", - "DefGraphPoint", - "CdefGraphPoint", - "VdefGraphPoint", - "PrintGraphPoint", - "GprintGraphPoint", - "CommentGraphPoint", - "HruleGraphPoint", - "VruleGraphPoint", - "LineGraphPoint", - "AreaGraphPoint", - "TickGraphPoint", - "ShiftGraphPoint", - "RRDThreshold", - "ServiceClass", - "ServiceOrganizer", - "Software", - "SoftwareClass", - "System", - "UserSettings", - "WinService", - "ZDeviceLoader", - "ZentinelPortal", - "ZenossInfo", - "ZenPackManager", + 'OSComponent', + 'OSProcess', + 'OSProcessClass', + 'OSProcessOrganizer', + 'OperatingSystem', + 'Organizer', + 'PerformanceConf', + 'PerformanceView', + 'PowerSupply', + 'PrintGraphPoint', + 'ProductClass', + 'RRDDataPoint', + 'RRDDataSource', + 'RRDGraph', + 'RRDTemplate', + 'RRDThreshold', + 'RRDView', + 'Report', + 'ReportClass', + 'Service', + 'ServiceClass', + 'ServiceOrganizer', + 'ShiftGraphPoint', + 'SiteError', + 'Software', + 'SoftwareClass', + 'StatusColor', + 'System', + 'TemperatureSensor', + 'TemplateContainer', + 'ThresholdClass', + 'ThresholdGraphPoint', + 'ThresholdInstance', + 'TickGraphPoint', + 'UserCommand', + 'UserSettings', + 'VdefGraphPoint', + 'VruleGraphPoint', + 'WinService', + 'XmlDataLoader', + 'ZDeviceLoader', + 'ZVersion', + 'ZenDate', + 'ZenMenu', + 'ZenMenuItem', + 'ZenMenuable', + 'ZenModelBase', + 'ZenModelItem', + 'ZenModelRM', + 'ZenPack', + 'ZenPackLoader', + 'ZenPackManager', + 'ZenPackPersistence', + 'ZenPackable', + 'ZenPacker', + 'ZenStatus', + 'ZenossInfo', + 'ZenossSecurity', + 'ZentinelPortal', ) # Make the skins available as DirectoryViews. |
From: <sv...@ze...> - 2008-05-14 20:52:17
|
Author: edahl Date: 2008-05-14 16:52:25 -0400 (Wed, 14 May 2008) New Revision: 9246 Added: tags/zenoss-2.2.0/ Log: * make new tag with zenpack fixes Copied: tags/zenoss-2.2.0 (from rev 9245, branches/zenoss-2.2.x) |
From: <sv...@ze...> - 2008-05-14 20:51:08
|
Author: edahl Date: 2008-05-14 16:51:16 -0400 (Wed, 14 May 2008) New Revision: 9245 Removed: tags/zenoss-2.2.0/ Log: * ready to slide that thing again |
From: <sv...@ze...> - 2008-05-14 20:30:15
|
Author: ian Date: 2008-05-14 16:30:23 -0400 (Wed, 14 May 2008) New Revision: 9244 Modified: branches/zenoss-2.2.x/Products/ZenModel/ZenPackManager.py Log: * Backporting ZenPackManager changes into the trunk Modified: branches/zenoss-2.2.x/Products/ZenModel/ZenPackManager.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/ZenPackManager.py 2008-05-14 20:02:41 UTC (rev 9243) +++ branches/zenoss-2.2.x/Products/ZenModel/ZenPackManager.py 2008-05-14 20:30:23 UTC (rev 9244) @@ -46,7 +46,7 @@ default_catalog = 'zenPackNameSearch' _relations = ZenModelRM._relations + ( - ('packs', ToManyCont(ToOne, 'Products.ZenModel.ZenPack', 'root')), + ('packs', ToManyCont(ToOne, 'Products.ZenModel.ZenPack', 'manager')), ) factory_type_information = ( |
From: <sv...@ze...> - 2008-05-14 20:02:34
|
Author: ian Date: 2008-05-14 16:02:41 -0400 (Wed, 14 May 2008) New Revision: 9243 Added: branches/zenoss-2.2.x/Products/ZenModel/TemplateContainer.py Modified: branches/zenoss-2.2.x/Products/ZenHub/tests/testRRDImpl.py branches/zenoss-2.2.x/Products/ZenModel/DeviceClass.py branches/zenoss-2.2.x/Products/ZenModel/MonitorClass.py branches/zenoss-2.2.x/Products/ZenModel/RRDTemplate.py branches/zenoss-2.2.x/Products/ZenModel/TemperatureSensor.py branches/zenoss-2.2.x/Products/ZenRelations/checkrel.py Log: * Backporting changes into branch Modified: branches/zenoss-2.2.x/Products/ZenHub/tests/testRRDImpl.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenHub/tests/testRRDImpl.py 2008-05-14 19:57:09 UTC (rev 9242) +++ branches/zenoss-2.2.x/Products/ZenHub/tests/testRRDImpl.py 2008-05-14 20:02:41 UTC (rev 9243) @@ -28,7 +28,7 @@ from Products.ZenHub.services.RRDImpl import RRDImpl from Products.ZenModel.Device import manage_createDevice d = manage_createDevice(self.dmd, - deviceName='127.0.0.10', + deviceName='127.0.0.1', devicePath='/Test') from Products.ZenModel.RRDTemplate import manage_addRRDTemplate manage_addRRDTemplate(self.dmd.Devices.Test.rrdTemplates, 'Device') Modified: branches/zenoss-2.2.x/Products/ZenModel/DeviceClass.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/DeviceClass.py 2008-05-14 19:57:09 UTC (rev 9242) +++ branches/zenoss-2.2.x/Products/ZenModel/DeviceClass.py 2008-05-14 20:02:41 UTC (rev 9243) @@ -45,6 +45,7 @@ import RRDTemplate from DeviceOrganizer import DeviceOrganizer from ZenPackable import ZenPackable +from TemplateContainer import TemplateContainer _marker = "__MARKER___" @@ -59,7 +60,7 @@ addDeviceClass = DTMLFile('dtml/addDeviceClass',globals()) -class DeviceClass(DeviceOrganizer, ZenPackable): +class DeviceClass(DeviceOrganizer, ZenPackable, TemplateContainer): """ DeviceClass is a device organizer that manages the primary classification of device objects within the zenoss system. It manages properties @@ -84,9 +85,9 @@ default_catalog = 'deviceSearch' - _relations = DeviceOrganizer._relations + ZenPackable._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + \ + TemplateContainer._relations + ( ("devices", ToManyCont(ToOne,"Products.ZenModel.Device","deviceClass")), - ("rrdTemplates", ToManyCont(ToOne,"Products.ZenModel.RRDTemplate","deviceClass")), ) # Screen action bindings (and tab definitions) Modified: branches/zenoss-2.2.x/Products/ZenModel/MonitorClass.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/MonitorClass.py 2008-05-14 19:57:09 UTC (rev 9242) +++ branches/zenoss-2.2.x/Products/ZenModel/MonitorClass.py 2008-05-14 20:02:41 UTC (rev 9243) @@ -30,6 +30,7 @@ from ZenModelRM import ZenModelRM from RRDTemplate import RRDTemplate +from TemplateContainer import TemplateContainer def manage_addMonitorClass(context, id, title = None, REQUEST = None): """make a device class""" @@ -44,7 +45,7 @@ from Products.ZenRelations.RelSchema import ToManyCont, ToOne -class MonitorClass(ZenModelRM, Folder): +class MonitorClass(ZenModelRM, Folder, TemplateContainer): #isInTree = 1 meta_type = "MonitorClass" sub_class = 'MonitorClass' @@ -79,11 +80,8 @@ ) security = ClassSecurityInfo() - _relations = ZenModelRM._relations + ( - ('rrdTemplates', ToManyCont(ToOne, 'Products.ZenModel.RRDTemplate', 'deviceClass')), - ) + _relations = TemplateContainer._relations - def __init__(self, id, title=None, buildRelations=True): ZenModelRM.__init__(self, id, title, buildRelations) Modified: branches/zenoss-2.2.x/Products/ZenModel/RRDTemplate.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/RRDTemplate.py 2008-05-14 19:57:09 UTC (rev 9242) +++ branches/zenoss-2.2.x/Products/ZenModel/RRDTemplate.py 2008-05-14 20:02:41 UTC (rev 9243) @@ -117,11 +117,16 @@ # by the graphDefinitionAndFriends migrate script for 2.1 _relations = ZenPackable._relations + ( - ("deviceClass", ToOne(ToManyCont,"Products.ZenModel.DeviceClass", "rrdTemplates")), - ("datasources", ToManyCont(ToOne,"Products.ZenModel.RRDDataSource", "rrdTemplate")), - ("graphs", ToManyCont(ToOne,"Products.ZenModel.RRDGraph", "rrdTemplate")), - ("thresholds", ToManyCont(ToOne,"Products.ZenModel.ThresholdClass", "rrdTemplate")), - ("graphDefs", ToManyCont(ToOne,"Products.ZenModel.GraphDefinition", "rrdTemplate")), + ("deviceClass", ToOne( + ToManyCont,"Products.ZenModel.TemplateContainer", "rrdTemplates")), + ("datasources", ToManyCont( + ToOne,"Products.ZenModel.RRDDataSource", "rrdTemplate")), + ("graphs", ToManyCont( + ToOne,"Products.ZenModel.RRDGraph", "rrdTemplate")), + ("thresholds", ToManyCont( + ToOne,"Products.ZenModel.ThresholdClass", "rrdTemplate")), + ("graphDefs", ToManyCont( + ToOne,"Products.ZenModel.GraphDefinition", "rrdTemplate")), ) Modified: branches/zenoss-2.2.x/Products/ZenModel/TemperatureSensor.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenModel/TemperatureSensor.py 2008-05-14 19:57:09 UTC (rev 9242) +++ branches/zenoss-2.2.x/Products/ZenModel/TemperatureSensor.py 2008-05-14 20:02:41 UTC (rev 9243) @@ -39,7 +39,8 @@ ) _relations = HWComponent._relations + ( - ("hw", ToOne(ToManyCont, "Products.ZenModel.DeviceHW", "fans")), + ("hw", ToOne( + ToManyCont, "Products.ZenModel.DeviceHW", "temperaturesensors")), ) Copied: branches/zenoss-2.2.x/Products/ZenModel/TemplateContainer.py (from rev 9242, trunk/Products/ZenModel/TemplateContainer.py) Modified: branches/zenoss-2.2.x/Products/ZenRelations/checkrel.py =================================================================== --- branches/zenoss-2.2.x/Products/ZenRelations/checkrel.py 2008-05-14 19:57:09 UTC (rev 9242) +++ branches/zenoss-2.2.x/Products/ZenRelations/checkrel.py 2008-05-14 20:02:41 UTC (rev 9243) @@ -22,6 +22,17 @@ from utils import importClass, importClasses from Products.ZenRelations.Exceptions import ZenSchemaError +def lookupSchema(cls, relname): + """ + Lookup the schema definition for a relationship. + All base classes are checked until RelationshipManager is found. + """ + for name, schema in cls._relations: + if name == relname: return schema + raise ZenSchemaError("Schema for relation %s not found on %s" % + (relname, cls.__name__)) + + def checkRelationshipSchema(cls, baseModule): """ Walk all relationship schema definitions and confirm that they @@ -33,10 +44,9 @@ except AttributeError, e: logging.critical("RemoteClass '%s' from '%s.%s' not found", rel.remoteClass, cls.__name__, relname) - continue - + continue try: - rschema = remoteClass.lookupSchema(rel.remoteName) + rschema = lookupSchema(remoteClass, rel.remoteName) except ZenSchemaError, e: logging.critical("Inverse def '%s' for '%s.%s' not found on '%s'", rel.remoteName, cls.__name__, relname,rel.remoteClass) @@ -45,6 +55,7 @@ logging.critical("RemoteClass '%s' for '%s.%s' problem.", rel.remoteName, cls.__name__, relname) logging.critical(e) + continue try: localClass = importClass(rschema.remoteClass, None) except AttributeError, e: @@ -71,6 +82,6 @@ skipnames=("ZentinelPortal", "ZDeviceLoader")) for classdef in classList: - if hasattr(classdef, "lookupSchema"): + if hasattr(classdef, '_relations'): logging.info("checking class %s...", classdef.__name__) checkRelationshipSchema(classdef, baseModule) |
From: <sv...@ze...> - 2008-05-14 19:57:02
|
Author: jstevens Date: 2008-05-14 15:57:09 -0400 (Wed, 14 May 2008) New Revision: 9242 Added: trunk/Products/ZenModel/TemplateContainer.py Modified: trunk/Products/ZenModel/DeviceClass.py trunk/Products/ZenModel/MonitorClass.py trunk/Products/ZenModel/RRDTemplate.py Log: fixes #3161 Modified: trunk/Products/ZenModel/DeviceClass.py =================================================================== --- trunk/Products/ZenModel/DeviceClass.py 2008-05-14 19:54:43 UTC (rev 9241) +++ trunk/Products/ZenModel/DeviceClass.py 2008-05-14 19:57:09 UTC (rev 9242) @@ -45,6 +45,7 @@ import RRDTemplate from DeviceOrganizer import DeviceOrganizer from ZenPackable import ZenPackable +from TemplateContainer import TemplateContainer _marker = "__MARKER___" @@ -59,7 +60,7 @@ addDeviceClass = DTMLFile('dtml/addDeviceClass',globals()) -class DeviceClass(DeviceOrganizer, ZenPackable): +class DeviceClass(DeviceOrganizer, ZenPackable, TemplateContainer): """ DeviceClass is a device organizer that manages the primary classification of device objects within the zenoss system. It manages properties @@ -84,9 +85,9 @@ default_catalog = 'deviceSearch' - _relations = DeviceOrganizer._relations + ZenPackable._relations + ( + _relations = DeviceOrganizer._relations + ZenPackable._relations + \ + TemplateContainer._relations + ( ("devices", ToManyCont(ToOne,"Products.ZenModel.Device","deviceClass")), - ("rrdTemplates", ToManyCont(ToOne,"Products.ZenModel.RRDTemplate","deviceClass")), ) # Screen action bindings (and tab definitions) Modified: trunk/Products/ZenModel/MonitorClass.py =================================================================== --- trunk/Products/ZenModel/MonitorClass.py 2008-05-14 19:54:43 UTC (rev 9241) +++ trunk/Products/ZenModel/MonitorClass.py 2008-05-14 19:57:09 UTC (rev 9242) @@ -30,6 +30,7 @@ from ZenModelRM import ZenModelRM from RRDTemplate import RRDTemplate +from TemplateContainer import TemplateContainer def manage_addMonitorClass(context, id, title = None, REQUEST = None): """make a device class""" @@ -44,7 +45,7 @@ from Products.ZenRelations.RelSchema import ToManyCont, ToOne -class MonitorClass(ZenModelRM, Folder): +class MonitorClass(ZenModelRM, Folder, TemplateContainer): #isInTree = 1 meta_type = "MonitorClass" sub_class = 'MonitorClass' @@ -79,11 +80,8 @@ ) security = ClassSecurityInfo() - _relations = ZenModelRM._relations + ( - ('rrdTemplates', ToManyCont(ToOne, 'Products.ZenModel.RRDTemplate', 'deviceClass')), - ) + _relations = TemplateContainer._relations - def __init__(self, id, title=None, buildRelations=True): ZenModelRM.__init__(self, id, title, buildRelations) Modified: trunk/Products/ZenModel/RRDTemplate.py =================================================================== --- trunk/Products/ZenModel/RRDTemplate.py 2008-05-14 19:54:43 UTC (rev 9241) +++ trunk/Products/ZenModel/RRDTemplate.py 2008-05-14 19:57:09 UTC (rev 9242) @@ -117,11 +117,16 @@ # by the graphDefinitionAndFriends migrate script for 2.1 _relations = ZenPackable._relations + ( - ("deviceClass", ToOne(ToManyCont,"Products.ZenModel.DeviceClass", "rrdTemplates")), - ("datasources", ToManyCont(ToOne,"Products.ZenModel.RRDDataSource", "rrdTemplate")), - ("graphs", ToManyCont(ToOne,"Products.ZenModel.RRDGraph", "rrdTemplate")), - ("thresholds", ToManyCont(ToOne,"Products.ZenModel.ThresholdClass", "rrdTemplate")), - ("graphDefs", ToManyCont(ToOne,"Products.ZenModel.GraphDefinition", "rrdTemplate")), + ("deviceClass", ToOne( + ToManyCont,"Products.ZenModel.TemplateContainer", "rrdTemplates")), + ("datasources", ToManyCont( + ToOne,"Products.ZenModel.RRDDataSource", "rrdTemplate")), + ("graphs", ToManyCont( + ToOne,"Products.ZenModel.RRDGraph", "rrdTemplate")), + ("thresholds", ToManyCont( + ToOne,"Products.ZenModel.ThresholdClass", "rrdTemplate")), + ("graphDefs", ToManyCont( + ToOne,"Products.ZenModel.GraphDefinition", "rrdTemplate")), ) Added: trunk/Products/ZenModel/TemplateContainer.py |
From: <sv...@ze...> - 2008-05-14 19:54:40
|
Author: jplouis Date: 2008-05-14 15:54:43 -0400 (Wed, 14 May 2008) New Revision: 9241 Modified: sandboxen/jplouis/Products-remoteStuff/DataCollector/zendisc.py sandboxen/jplouis/Products-remoteStuff/ZenModel/Device.py sandboxen/jplouis/Products-remoteStuff/ZenModel/PerformanceConf.py sandboxen/jplouis/Products-remoteStuff/ZenModel/ZDeviceLoader.py sandboxen/jplouis/Products-remoteStuff/ZenModel/skins/zenmodel/addDevice.pt Log: first pass at refactoring add device to use zendisc. Modified: sandboxen/jplouis/Products-remoteStuff/DataCollector/zendisc.py =================================================================== --- sandboxen/jplouis/Products-remoteStuff/DataCollector/zendisc.py 2008-05-14 19:50:48 UTC (rev 9240) +++ sandboxen/jplouis/Products-remoteStuff/DataCollector/zendisc.py 2008-05-14 19:54:43 UTC (rev 9241) @@ -160,6 +160,13 @@ self.log.debug("Doing SNMP lookup on device %s", ip) yield self.config().callRemote('getSnmpConfig', devicePath) communities, port, version, timeout, retries = driver.next() + + # Override with the stuff passed in + if self.options.zSnmpVer: version = self.options.zSnmpVer + if self.options.zSnmpPort: port = self.options.zSnmpPort + if self.options.zSnmpCommunity: + communities = (self.options.zSnmpCommunity,) + versions = ("v2c", "v1") if '1' in version: versions = list(versions) @@ -209,25 +216,45 @@ def inner(driver): try: name = ip + useDeviceName = False + if self.options.device and not isip(self.options.device): + name = self.options.device + useDeviceName = True kw = dict(deviceName=name, discoverProto=None, devicePath=devicepath, performanceMonitor=self.options.monitor) + + snmpDeviceInfo = None if not self.options.nosnmp: self.log.debug("Scanning device with address %s", ip) yield self.findRemoteDeviceInfo(ip, devicepath) - deviceInfo = driver.next() - if deviceInfo: - community, port, ver, snmpname = deviceInfo + snmpDeviceInfo = driver.next() + if snmpDeviceInfo: + community, port, ver, snmpname = snmpDeviceInfo kw.update(dict(deviceName=snmpname, zSnmpCommunity=community, zSnmpPort=port, zSnmpVer=ver)) - yield asyncNameLookup(ip) - try: - kw.update(dict(deviceName=driver.next())) - except Exception, ex: - self.log.debug("Failed to lookup %s (%s)" % (ip, ex)) + if not snmpDeviceInfo or self.options.nosnmp: + """use the port set via commandline incase + findRemoteDeviceInfo did not return data; this should + make sure the device is created with correct snmp + options and zenmodeler runs with correct options""" + if self.options.zSnmpPort: + kw.update(dict(zSnmpPort=self.options.zSnmpPort)) + if self.options.zSnmpVer: + kw.update(dict(zSnmpVer=self.options.zSnmpVer)) + if self.options.zSnmpCommunity: + kw.update(dict(zSnmpCommunitY = self.options.zSnmpCommunity)) + if useDeviceName: + kw.update(dict(deviceName=name)) + else: + yield asyncNameLookup(ip) + try: + kw.update(dict(deviceName=driver.next())) + except Exception, ex: + self.log.debug("Failed to lookup %s (%s)" % (ip, ex)) yield self.config().callRemote('createDevice', ip, **kw) result = driver.next() if isinstance(result, Failure): @@ -451,6 +478,12 @@ self.parser.add_option('--chunk', dest='chunkSize', default=10, type="int", help="number of in flight ping packets") + self.parser.add_option('--snmp-version', dest='zSnmpVer', + help="SNMP version of the target") + self.parser.add_option('--snmp-community', dest='zSnmpCommunity', + help="SNMP community string of the target") + self.parser.add_option('--snmp-port', dest='zSnmpPort', + type="int", help="SNMP port of the target") self.parser.add_option('--snmp-missing', dest='snmpMissing', action="store_true", default=False, help="send an event if SNMP is not found on the device") @@ -469,7 +502,6 @@ self.parser.add_option('--useFileDescriptor', dest='useFileDescriptor', default=None, help="Use the given (priveleged) file descriptor for ping") - self.parser.add_option('--assign-devclass-script', dest='autoAllocate', action="store_true", default=False, help="have zendisc auto allocate devices after discovery") Modified: sandboxen/jplouis/Products-remoteStuff/ZenModel/Device.py =================================================================== --- sandboxen/jplouis/Products-remoteStuff/ZenModel/Device.py 2008-05-14 19:50:48 UTC (rev 9240) +++ sandboxen/jplouis/Products-remoteStuff/ZenModel/Device.py 2008-05-14 19:54:43 UTC (rev 9241) @@ -159,7 +159,7 @@ def findCommunity(context, ip, devicePath, community="", port=None, version=None): """ - Find the SNMP community and version for an p address using zSnmpCommunities. + Find the SNMP community and version for an ip address using zSnmpCommunities. @rtype: tuple of (community, port, version, device name) """ @@ -1077,8 +1077,9 @@ log.info("setting system %s" % systemPaths) self.setSystems(systemPaths) - log.info("setting performance monitor to %s" % performanceMonitor) - self.setPerformanceMonitor(performanceMonitor) + if performanceMonitor != self.getPerformanceServerName(): + log.info("setting performance monitor to %s" % performanceMonitor) + self.setPerformanceMonitor(performanceMonitor) self.setLastChange() self.index_object() @@ -1579,21 +1580,10 @@ @todo: generateEvents param is not being used. """ unused(generateEvents) - xmlrpc = isXmlRpc(REQUEST) - if setlog and REQUEST and not xmlrpc: - handler = setupLoggingHeader(self, REQUEST) - - zm = zenPath('bin', 'zenmodeler') - zenmodelerCmd = [zm, 'run', '--now','-F','-d', self.id] - if REQUEST: zenmodelerCmd.append("--weblog") - result = executeCommand(zenmodelerCmd, REQUEST) - if result and xmlrpc: return result - log.info("configuration collected") + perfConf = self.getPerformanceServer() + perfConf.collectDevice(self, setlog, REQUEST) - if setlog and REQUEST and not xmlrpc: - clearWebLoggingStream(handler) - if xmlrpc: return 0 Modified: sandboxen/jplouis/Products-remoteStuff/ZenModel/PerformanceConf.py =================================================================== --- sandboxen/jplouis/Products-remoteStuff/ZenModel/PerformanceConf.py 2008-05-14 19:50:48 UTC (rev 9240) +++ sandboxen/jplouis/Products-remoteStuff/ZenModel/PerformanceConf.py 2008-05-14 19:54:43 UTC (rev 9241) @@ -37,23 +37,31 @@ s = s.replace('\n','') return s import xmlrpclib - + from AccessControl import ClassSecurityInfo +from AccessControl import Permissions as permissions from Globals import DTMLFile from Globals import InitializeClass - +from Monitor import Monitor from Products.PythonScripts.standard import url_quote -from AccessControl import Permissions as permissions from Products.ZenModel.ZenossSecurity import * - from Products.ZenRelations.RelSchema import * - from Products.ZenUtils.Utils import basicAuthUrl, zenPath - -from Monitor import Monitor +from Products.ZenUtils.Utils import unused +from Products.ZenUtils.Utils import isXmlRpc +from Products.ZenUtils.Utils import setupLoggingHeader +from Products.ZenUtils.Utils import executeCommand +from Products.ZenUtils.Utils import clearWebLoggingStream +from Products.ZenModel.Exceptions import DeviceExistsError +from Products.ZenUtils.IpUtil import isip +from Device import manage_createDevice from StatusColor import StatusColor -from Products.ZenUtils.Utils import unused + + + + + PERF_ROOT=None def performancePath(target): @@ -369,6 +377,110 @@ if dev.monitorDevice() and not dev.zPingMonitorIgnore: devices.append(dev) return devices + + def createDevice(self, context, deviceName, devicePath="/Discovered", + tag="", serialNumber="", + zSnmpCommunity="", zSnmpPort=161, zSnmpVer="", + rackSlot=0, productionState=1000, comments="", + hwManufacturer="", hwProductName="", + osManufacturer="", osProductName="", + locationPath="", groupPaths=[], systemPaths=[], + performanceMonitor="localhost", + discoverProto="snmp", priority=3, REQUEST = None): + + """ + Create a device in a performance monitor specific fashion. + Creates device by delegating to manage_createDevice + @rtype: Device + """ + + if isip(deviceName) and self.getDmdRoot('Networks').findIp(deviceName): + device = self.getDmdRoot('Networks').findIp(deviceName) + raise DeviceExistsError("Ip %s exists on %s" % (deviceName, device.id)) + elif self.getDmdRoot("Devices").findDevice(deviceName): + raise DeviceExistsError("Device %s already exists" % deviceName) + + + device = None + try: + device = self._createDevice(deviceName, devicePath, productionState, + performanceMonitor, discoverProto, zSnmpPort, REQUEST) +#need to call zendisc and interpret exit codes? Then update properties. + + if device: + kw = dict(tag=tag, + serialNumber=serialNumber, + rackSlot=rackSlot, + prodauctionState=productionState, + comments=comments, + hwManufacturer=hwManufacturer, + hwProductName = hwProductName, + osManufacturer = osManufacturer, + osProductName = osProductName, + locationPath = locationPath, + groupPaths = groupPaths, + systemPaths = systemPaths, + performanceMonitor = performanceMonitor, + priority = priority) + device.manage_editDevice(**kw) + else: + log.info("no device returned") + + except Exception: raise + return device + def _createDevice(self, deviceName, devicePath= "/Discovered", + productionState=1000, performanceMonitor="localhost", + discoverProto="snmp", zSnmpPort=161,REQUEST=None): + """ + Actual implementation for creating/adding a device to the system. + """ + xmlrpc = isXmlRpc(REQUEST) + + ''' + todo add snmp variables + ''' + zm = zenPath('bin', 'zendisc') + zendiscCmd = [zm, 'run', '--now','-d', deviceName, + '--monitor', performanceMonitor, + '--deviceclass', devicePath, + '--snmp-port', str(zSnmpPort) ] + if REQUEST: zendiscCmd.append("--weblog") + + + result = executeCommand(zendiscCmd, REQUEST) + + + log.info("zendisc result : %s" % result) + + device = self.getDmdRoot("Devices").findDevice(deviceName) + return device + + + + def collectDevice(self, device=None, setlog=True, REQUEST=None, generateEvents=False): + """ + Collect the configuration of this device AKA Model Device + + @param setlog: If true, set up the output log of this process + @permission: ZEN_MANAGE_DEVICE + """ + + xmlrpc = isXmlRpc(REQUEST) + if setlog and REQUEST and not xmlrpc: + handler = setupLoggingHeader(self, REQUEST) + + zm = zenPath('bin', 'zenmodeler') + zenmodelerCmd = [zm, 'run', '--now','-F','-d', device.id] + if REQUEST: zenmodelerCmd.append("--weblog") + result = executeCommand(zenmodelerCmd, REQUEST) + if result and xmlrpc: return result + log.info("configuration collected") + + if setlog and REQUEST and not xmlrpc: + clearWebLoggingStream(handler) + + if xmlrpc: return 0 + InitializeClass(PerformanceConf) Modified: sandboxen/jplouis/Products-remoteStuff/ZenModel/ZDeviceLoader.py =================================================================== --- sandboxen/jplouis/Products-remoteStuff/ZenModel/ZDeviceLoader.py 2008-05-14 19:50:48 UTC (rev 9240) +++ sandboxen/jplouis/Products-remoteStuff/ZenModel/ZDeviceLoader.py 2008-05-14 19:54:43 UTC (rev 9241) @@ -28,7 +28,6 @@ from OFS.SimpleItem import SimpleItem -from Device import manage_createDevice from Products.ZenUtils.Utils import isXmlRpc, setupLoggingHeader, clearWebLoggingStream from Products.ZenUtils.Exceptions import ZentinelException from Products.ZenModel.Exceptions import DeviceExistsError, NoSnmp @@ -86,7 +85,7 @@ osManufacturer="", osProductName="", locationPath="", groupPaths=[], systemPaths=[], performanceMonitor="localhost", - discoverProto="snmp",REQUEST = None): + discoverProto="snmp",priority=3,REQUEST = None): """ Load a device into the database connecting its major relations and collecting its configuration. @@ -98,16 +97,24 @@ print xmlrpc if REQUEST and not xmlrpc: handler = setupLoggingHeader(self, REQUEST) + + """ + Get performance monitor and call createDevice so that the correct + version (local/remote) of createDevice gets invoked + """ + monitor = self.getDmdRoot("Monitors").getPerformanceMonitor( + performanceMonitor) try: - device = manage_createDevice(self, deviceName, devicePath, - tag, serialNumber, - zSnmpCommunity, zSnmpPort, zSnmpVer, - rackSlot, productionState, comments, - hwManufacturer, hwProductName, - osManufacturer, osProductName, - locationPath, groupPaths, systemPaths, - performanceMonitor, discoverProto) + device = monitor.createDevice(self, deviceName, devicePath, + tag, serialNumber, + zSnmpCommunity, zSnmpPort, zSnmpVer, + rackSlot, productionState, comments, + hwManufacturer, hwProductName, + osManufacturer, osProductName, + locationPath, groupPaths, systemPaths, + performanceMonitor, discoverProto, + priority,REQUEST) transaction.commit() except (SystemExit, KeyboardInterrupt): raise except ZentinelException, e: @@ -124,8 +131,6 @@ log.exception('load of device %s failed' % deviceName) transaction.abort() else: - if discoverProto != "none": - device.collectDevice(setlog=False, REQUEST=REQUEST) log.info("Device %s loaded!" % deviceName) if REQUEST and not xmlrpc: Modified: sandboxen/jplouis/Products-remoteStuff/ZenModel/skins/zenmodel/addDevice.pt =================================================================== --- sandboxen/jplouis/Products-remoteStuff/ZenModel/skins/zenmodel/addDevice.pt 2008-05-14 19:50:48 UTC (rev 9240) +++ sandboxen/jplouis/Products-remoteStuff/ZenModel/skins/zenmodel/addDevice.pt 2008-05-14 19:54:43 UTC (rev 9241) @@ -56,7 +56,7 @@ </tr> <tr> <td class="tableheader" align="left">Discovery Protocol</td> - <td class="tablevalues" align="left" colspan=3> + <td class="tablevalues" align="left" > <select class="tablevalues" name="discoverProto"> <option value="snmp">snmp</option> <!-- @@ -66,6 +66,20 @@ <option value="none">none</option> </select> </td> + <td class="tableheader" align="left">Collector</td> + <td class="tablevalues" align="left"> + <select class="tablevalues" name="performanceMonitor" + tal:define=" + crks python:here.getDmdRoot('Monitors').getPerformanceMonitorNames(); + curcrk here/getPerformanceServerName | request/performanceMonitor | + string:localhost" + > + <option tal:repeat="crk crks" + tal:attributes="value crk; + selected python:curcrk and crk in curcrk" + tal:content="crk">localhost</option> + </select> + </td> </tr> <tal:block metal:define-macro="body" tal:omit-tag=""> <tr><th class="subtabletitle" colspan=4 align="left">Attributes</th></tr> @@ -320,22 +334,6 @@ </td> </tr> <tr> - <td class="tableheader" align="left">Collector</td> - <td class="tablevalues" align="left" colspan=3> - <select class="tablevalues" name="performanceMonitor" - tal:define=" - crks python:here.getDmdRoot('Monitors').getPerformanceMonitorNames(); - curcrk here/getPerformanceServerName | request/performanceMonitor | - string:localhost" - > - <option tal:repeat="crk crks" - tal:attributes="value crk; - selected python:curcrk and crk in curcrk" - tal:content="crk">localhost</option> - </select> - </td> - </tr> - <tr> <td class="tableheader" align="left">New Collector</td> <td class="tablevalues" align="left" colspan="3"> <input class="tablevalues" type="text" |