Skip to content
Browse files

Fixing test for nose and Zenoss 4.

  • Loading branch information...
1 parent 4856850 commit c34e5fa1b37606e228d077afcc7c78a384917707 @cluther cluther committed Jan 3, 2012
Showing with 16 additions and 2 deletions.
  1. +6 −0 ZenPacks/zenoss/RabbitMQ/__init__.py
  2. +10 −2 ZenPacks/zenoss/RabbitMQ/tests/testParser.py
View
6 ZenPacks/zenoss/RabbitMQ/__init__.py
@@ -19,10 +19,16 @@
import logging
log = logging.getLogger('zen.RabbitMQ')
+import Globals
+
from Products.ZenEvents.EventManagerBase import EventManagerBase
from Products.ZenModel.Device import Device
from Products.ZenModel.ZenPack import ZenPack as ZenPackBase
from Products.ZenRelations.RelSchema import ToManyCont, ToOne
+from Products.ZenUtils.Utils import unused
+
+unused(Globals)
+
ZENPACK_NAME = 'ZenPacks.zenoss.RabbitMQ'
View
12 ZenPacks/zenoss/RabbitMQ/tests/testParser.py
@@ -12,7 +12,7 @@
###########################################################################
from Products.ZenRRD.CommandParser import ParsedResults
-from Products.ZenRRD.zencommand import Cmd, DataPointConfig, DeviceConfig
+from Products.ZenRRD.zencommand import Cmd, DataPointConfig
from Products.ZenTestCase.BaseTestCase import BaseTestCase
from ..parsers.RabbitMQCTL import RabbitMQCTL as RabbitMQCTLParser
@@ -32,7 +32,15 @@ def __init__(self, exitCode, output):
class TestParser(BaseTestCase):
def _getCmd(self, component, command, exitCode, output_filename, points):
cmd = Cmd()
- cmd.deviceConfig = DeviceConfig()
+
+ # DeviceConfig no longer exists as of Zenoss 4.
+ try:
+ from Products.ZenRRD.zencommand import DeviceConfig
+ cmd.deviceConfig = DeviceConfig()
+ except ImportError:
+ from Products.ZenCollector.services.config import DeviceProxy
+ cmd.deviceConfig = DeviceProxy()
+
cmd.deviceConfig.device = 'maverick'
cmd.component = component
cmd.command = command

0 comments on commit c34e5fa

Please sign in to comment.
Something went wrong with that request. Please try again.