Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try:
import ZenPacks.zenoss.DynamicView
zcml.load_config('configure.zcml', ZenPacks.zenoss.DynamicView)
except ImportError:
return
try:
import ZenPacks.zenoss.Impact
zcml.load_config('meta.zcml', ZenPacks.zenoss.Impact)
zcml.load_config('configure.zcml', ZenPacks.zenoss.Impact)
except ImportError:
return
# BaseTestCast.afterSetUp already hides transaction.commit. So we also
# need to hide transaction.abort.
self._transaction_abort = Transaction.abort
Transaction.abort = lambda *x: None
try:
import ZenPacks.zenoss.Impact
zcml.load_config('meta.zcml', ZenPacks.zenoss.Impact)
zcml.load_config('configure.zcml', ZenPacks.zenoss.Impact)
except ImportError:
pass
try:
zcml.load_config('configure.zcml', zenpack_module)
except IOError:
pass
# BaseTestCast.afterSetUp already hides transaction.commit. So we also
# need to hide transaction.abort.
self._transaction_abort = Transaction.abort
Transaction.abort = lambda *x: None
import ZenPacks.zenoss.DynamicView
zcml.load_config('configure.zcml', ZenPacks.zenoss.DynamicView)
except ImportError:
return
try:
import ZenPacks.zenoss.Impact
zcml.load_config('meta.zcml', ZenPacks.zenoss.Impact)
zcml.load_config('configure.zcml', ZenPacks.zenoss.Impact)
except ImportError:
return
# BaseTestCast.afterSetUp already hides transaction.commit. So we also
# need to hide transaction.abort.
self._transaction_abort = Transaction.abort
Transaction.abort = lambda *x: None
try:
import ZenPacks.zenoss.DynamicView
zcml.load_config('configure.zcml', ZenPacks.zenoss.DynamicView)
except ImportError:
return
try:
import ZenPacks.zenoss.Impact
zcml.load_config('meta.zcml', ZenPacks.zenoss.Impact)
zcml.load_config('configure.zcml', ZenPacks.zenoss.Impact)
except ImportError:
return
# BaseTestCast.afterSetUp already hides transaction.commit. So we also
# need to hide transaction.abort.
self._transaction_abort = Transaction.abort
Transaction.abort = lambda *x: None
try:
import ZenPacks.zenoss.Impact
zcml.load_config('meta.zcml', ZenPacks.zenoss.Impact)
zcml.load_config('configure.zcml', ZenPacks.zenoss.Impact)
except ImportError:
pass
try:
zcml.load_config('configure.zcml', zenpack_module)
except IOError:
pass
# BaseTestCast.afterSetUp already hides transaction.commit. So we also
# need to hide transaction.abort.
self._transaction_abort = Transaction.abort
Transaction.abort = lambda *x: None
def beforeTearDown(self):
super(TestCase, self).beforeTearDown()
if hasattr(self, '_transaction_abort'):
Transaction.abort = self._transaction_abort
import ZenPacks.zenoss.DynamicView
zcml.load_config('configure.zcml', ZenPacks.zenoss.DynamicView)
except ImportError:
return
try:
import ZenPacks.zenoss.Impact
zcml.load_config('meta.zcml', ZenPacks.zenoss.Impact)
zcml.load_config('configure.zcml', ZenPacks.zenoss.Impact)
except ImportError:
return
# BaseTestCast.afterSetUp already hides transaction.commit. So we also
# need to hide transaction.abort.
self._transaction_abort = Transaction.abort
Transaction.abort = lambda *x: None
def beforeTearDown(self):
super(TestCase, self).beforeTearDown()
if hasattr(self, '_transaction_abort'):
Transaction.abort = self._transaction_abort
def beforeTearDown(self):
super(TestCase, self).beforeTearDown()
if hasattr(self, '_transaction_abort'):
Transaction.abort = self._transaction_abort
def beforeTearDown(self):
super(TestCase, self).beforeTearDown()
if hasattr(self, '_transaction_abort'):
Transaction.abort = self._transaction_abort