From 712d68a47055772f96aa81d49101993e1746bdcb Mon Sep 17 00:00:00 2001 From: Jason Peacock Date: Mon, 19 Jun 2023 09:43:27 -0500 Subject: [PATCH] Refactor zenPath, binPath, varPath imports to import from ZenUtils.path --- Products/DataCollector/Plugins.py | 3 ++- .../plugins/zenoss/debug/FakeComponents.py | 2 +- .../zenoss/debug/ReplayProcessedResults.py | 2 +- .../plugins/zenoss/debug/ReplayRawResults.py | 2 +- Products/DataCollector/zenmodeler.py | 3 ++- Products/Jobber/config.py | 2 +- Products/Jobber/log.py | 2 +- Products/Jobber/monitor/command.py | 2 +- .../ZenCallHome/transport/crypt/__init__.py | 2 +- Products/ZenCallHome/transport/cycler.py | 2 +- .../ZenCollector/configcache/app/config.py | 2 +- .../ZenCollector/configcache/app/logger.py | 2 +- Products/ZenCollector/configcache/app/pid.py | 2 +- Products/ZenCollector/configcache/app/zodb.py | 3 ++- Products/ZenEvents/EventClassInst.py | 2 +- Products/ZenEvents/tests/sendSnmpPcap.py | 2 +- Products/ZenEvents/zeneventd.py | 2 +- Products/ZenEvents/zeneventdWorkers.py | 2 +- Products/ZenEvents/zensendsyslog.py | 2 +- Products/ZenEvents/zensyslog/loggers.py | 2 +- Products/ZenEvents/zentestsyslogrules.py | 2 +- Products/ZenHub/zenhub.py | 7 ++---- .../ZenMessaging/queuemessaging/schema.py | 2 +- Products/ZenModel/DataRoot.py | 3 ++- Products/ZenModel/IpNetwork.py | 4 ++-- Products/ZenModel/MibOrganizer.py | 3 ++- Products/ZenModel/PerformanceConf.py | 3 ++- Products/ZenModel/RRDDataSource.py | 2 +- Products/ZenModel/ZenModelBase.py | 3 ++- Products/ZenModel/ZenModelRM.py | 3 ++- Products/ZenModel/ZenPack.py | 3 ++- Products/ZenModel/ZenPackLoader.py | 2 +- Products/ZenModel/ZenPackManager.py | 2 +- Products/ZenModel/ZenossInfo.py | 2 +- Products/ZenModel/migrate/Migrate.py | 2 +- .../ZenModel/migrate/addMariaDBLogFilters.py | 2 +- .../ZenModel/migrate/addNginxLogFilters.py | 2 +- .../migrate/addOpenTSDBLogbackConfig.py | 2 +- .../ZenModel/migrate/addRabbitMQGlobalConf.py | 2 +- .../ZenModel/migrate/addRabbitMQLogFilters.py | 2 +- .../ZenModel/migrate/addRedisLogFilters.py | 2 +- Products/ZenModel/migrate/addSolrService.py | 2 +- .../ZenModel/migrate/addThebeLogFilters.py | 2 +- .../addZeneventserverstdioLogFilters.py | 2 +- .../migrate/addZookeeperLogFilters.py | 2 +- .../migrate/betterstandarderrormessage.py | 2 +- Products/ZenModel/migrate/command.py | 2 +- Products/ZenModel/migrate/datapoints.py | 2 +- .../evenbettererstandarderrormessage.py | 2 +- .../migrate/evenbetterstandarderrormessage.py | 2 +- .../evenmorebettererstandarderrormessage.py | 2 +- .../ZenModel/migrate/fixHbaseLogFilters.py | 2 +- .../migrate/fixMetricShipperLogFilters.py | 2 +- .../ZenModel/migrate/fixOpentsdbLogFilters.py | 2 +- .../ZenModel/migrate/fixZminionLogFilters.py | 2 +- Products/ZenModel/migrate/hoist_perf_data.py | 2 +- .../migrate/import_export_filesystem.py | 2 +- Products/ZenModel/migrate/kill_cricket.py | 2 +- Products/ZenModel/migrate/menus.py | 2 +- .../ZenModel/migrate/monitorTemplateMenu.py | 2 +- Products/ZenModel/migrate/moveZepConfig.py | 2 +- .../ZenModel/migrate/nginxConfigForZauth.py | 2 +- Products/ZenModel/migrate/pagecommand.py | 2 +- Products/ZenModel/migrate/processes.py | 2 +- Products/ZenModel/migrate/procparams.py | 2 +- .../migrate/removeClearHeartbeatsMenuItem.py | 1 - Products/ZenModel/migrate/smtpsnpp.py | 2 +- .../ZenModel/migrate/standarderrormessage.py | 2 +- .../tests/test_addMariaDBLogFilters.py | 2 +- .../migrate/tests/test_addNginxLogFilters.py | 2 +- .../tests/test_addRabbitMQLogFilters.py | 2 +- .../migrate/tests/test_addRedisLogFilters.py | 2 +- .../migrate/tests/test_addSolrService.py | 2 +- .../migrate/tests/test_addThebeLogFilters.py | 2 +- .../test_addZeneventserverstdioLogFilters.py | 2 +- .../tests/test_addZookeeperLogFilters.py | 2 +- .../migrate/tests/test_fixHbaseLogFilters.py | 2 +- .../tests/test_fixMetricShipperLogFilters.py | 2 +- .../tests/test_fixOpentsdbLogFilters.py | 2 +- .../tests/test_fixZminionLogFilters.py | 2 +- .../tests/test_updateRegionServerGraphs.py | 2 +- .../ZenModel/migrate/twopointohobjects.py | 2 +- .../migrate/updateOpenTSDBOriginalConfig.py | 2 +- .../ZenModel/migrate/updateSolrConfigs.py | 2 +- .../updateZeneventserverstdioLogPaths.py | 2 +- .../migrate/winmodelerUnderModeler.py | 2 +- Products/ZenModel/migrate/zpsitecustomize.py | 2 +- Products/ZenModel/tests/testImport.py | 2 +- Products/ZenModel/zenbuild.py | 2 +- Products/ZenModel/zendmd.py | 3 ++- Products/ZenModel/zenmib.py | 2 +- Products/ZenRRD/tests/testzenprocess.py | 2 +- Products/ZenRelations/schemadoc.py | 2 +- Products/ZenRelations/tests/testImport.py | 2 +- Products/ZenReports/ReportLoader.py | 2 +- Products/ZenReports/ReportServer.py | 3 ++- Products/ZenStatus/zenping.py | 3 ++- Products/ZenUI3/browser/testing.py | 2 +- Products/ZenUI3/browser/views.py | 2 +- Products/ZenUtils/CmdBase.py | 2 +- Products/ZenUtils/ConfDaemon.py | 2 +- Products/ZenUtils/EggifyZenPack.py | 2 +- Products/ZenUtils/GlobalConfig.py | 3 ++- Products/ZenUtils/RunCommand.py | 2 +- Products/ZenUtils/Watchdog.py | 2 +- Products/ZenUtils/ZCmdBase.py | 3 ++- Products/ZenUtils/ZenBackup.py | 3 ++- Products/ZenUtils/ZenCheckZenDS.py | 2 +- Products/ZenUtils/ZenDaemon.py | 3 ++- Products/ZenUtils/ZenPackCmd.py | 3 ++- Products/ZenUtils/ZenPackDaemons.py | 2 +- Products/ZenUtils/ZenRestore.py | 3 ++- Products/ZenUtils/ZenScriptBase.py | 3 ++- Products/ZenUtils/configlog.py | 2 +- Products/ZenUtils/dbverify.py | 2 +- Products/ZenUtils/deprecated.py | 2 +- Products/ZenUtils/mib/tests/test_smidump.py | 2 +- Products/ZenUtils/tbdetail.py | 2 +- Products/ZenUtils/tests/testDeprecated.py | 2 +- Products/ZenUtils/tests/testFindEggs.py | 2 +- Products/ZenUtils/zenpack.py | 3 ++- Products/ZenWidgets/Portlet.py | 2 +- Products/Zuul/facades/mibfacade.py | 3 ++- Products/Zuul/facades/networkfacade.py | 2 +- Products/Zuul/facades/processfacade.py | 2 +- Products/Zuul/routers/nav.py | 2 +- bin/addSystemUser.py | 2 +- bin/zenbincheck | 2 +- bin/zendoc_base | 3 ++- bin/zendoc_zenpack | 23 +++++++++++-------- bin/zenossdbpack | 2 +- bin/zenrun.d/zenpack-manager.sh | 2 +- 132 files changed, 168 insertions(+), 145 deletions(-) diff --git a/Products/DataCollector/Plugins.py b/Products/DataCollector/Plugins.py index ae5b1b3f72..83e55b1f92 100644 --- a/Products/DataCollector/Plugins.py +++ b/Products/DataCollector/Plugins.py @@ -42,7 +42,8 @@ class that shares the module's name from twisted.spread import pb -from Products.ZenUtils.Utils import importClass, zenPath +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import importClass log = logging.getLogger("zen.Plugins") diff --git a/Products/DataCollector/plugins/zenoss/debug/FakeComponents.py b/Products/DataCollector/plugins/zenoss/debug/FakeComponents.py index ba36860ae3..d9fda23db5 100644 --- a/Products/DataCollector/plugins/zenoss/debug/FakeComponents.py +++ b/Products/DataCollector/plugins/zenoss/debug/FakeComponents.py @@ -32,7 +32,7 @@ from ConfigParser import RawConfigParser from Products.DataCollector.plugins.CollectorPlugin import PythonPlugin -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class MissingModelerPluginSectionArgument(Exception): diff --git a/Products/DataCollector/plugins/zenoss/debug/ReplayProcessedResults.py b/Products/DataCollector/plugins/zenoss/debug/ReplayProcessedResults.py index 9b6033b4d1..8023f23aad 100644 --- a/Products/DataCollector/plugins/zenoss/debug/ReplayProcessedResults.py +++ b/Products/DataCollector/plugins/zenoss/debug/ReplayProcessedResults.py @@ -31,7 +31,7 @@ from ConfigParser import RawConfigParser from Products.DataCollector.plugins.CollectorPlugin import PythonPlugin -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class ReplayProcessedResults(PythonPlugin): diff --git a/Products/DataCollector/plugins/zenoss/debug/ReplayRawResults.py b/Products/DataCollector/plugins/zenoss/debug/ReplayRawResults.py index fe8fbf973b..63fba67e75 100644 --- a/Products/DataCollector/plugins/zenoss/debug/ReplayRawResults.py +++ b/Products/DataCollector/plugins/zenoss/debug/ReplayRawResults.py @@ -35,7 +35,7 @@ from Products.DataCollector.Plugins import loadPlugins from Products.DataCollector.plugins.CollectorPlugin import PythonPlugin -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.zenmodeler.ReplayRawResults") diff --git a/Products/DataCollector/zenmodeler.py b/Products/DataCollector/zenmodeler.py index a1d845451d..1c5d3a050d 100644 --- a/Products/DataCollector/zenmodeler.py +++ b/Products/DataCollector/zenmodeler.py @@ -58,7 +58,8 @@ from Products.ZenHub.interfaces import IEventService from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon, HubDown from Products.ZenUtils.Driver import drive, driveLater -from Products.ZenUtils.Utils import unused, zenPath, wait +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import unused, wait from Products.Zuul.utils import safe_hasattr as hasattr # needed for Twisted's PB (Perspective Broker) to work diff --git a/Products/Jobber/config.py b/Products/Jobber/config.py index e065962f6d..cdfe69a77c 100644 --- a/Products/Jobber/config.py +++ b/Products/Jobber/config.py @@ -14,7 +14,7 @@ from Products.ZenUtils.config import Config, ConfigLoader from Products.ZenUtils.GlobalConfig import getGlobalConfiguration from Products.ZenUtils.RedisUtils import DEFAULT_REDIS_URL -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath _default_configs = { diff --git a/Products/Jobber/log.py b/Products/Jobber/log.py index 21b64c322a..6500219b77 100644 --- a/Products/Jobber/log.py +++ b/Products/Jobber/log.py @@ -22,7 +22,7 @@ from inotify_simple import INotify, flags as Flags from zope.component import getUtility -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from .config import getConfig from .interfaces import IJobStore diff --git a/Products/Jobber/monitor/command.py b/Products/Jobber/monitor/command.py index 3e1c27fbb3..58e1f3a7d1 100644 --- a/Products/Jobber/monitor/command.py +++ b/Products/Jobber/monitor/command.py @@ -16,7 +16,7 @@ from Products.ZenCollector.configcache.app.args import ZenHelpFormatter from Products.ZenUtils.config import ConfigLoader -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from .broker import Broker from .collector import MetricsCollector diff --git a/Products/ZenCallHome/transport/crypt/__init__.py b/Products/ZenCallHome/transport/crypt/__init__.py index 02ccf91e38..36cd52669c 100644 --- a/Products/ZenCallHome/transport/crypt/__init__.py +++ b/Products/ZenCallHome/transport/crypt/__init__.py @@ -11,7 +11,7 @@ import os import subprocess -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath logger = logging.getLogger("zen.callhome") diff --git a/Products/ZenCallHome/transport/cycler.py b/Products/ZenCallHome/transport/cycler.py index 93cbf2a2e7..7b6f50d178 100644 --- a/Products/ZenCallHome/transport/cycler.py +++ b/Products/ZenCallHome/transport/cycler.py @@ -20,7 +20,7 @@ from Products.ZenCallHome.CallHomeStatus import CallHomeStatus from Products.ZenCallHome.transport import CallHome from Products.ZenCallHome.transport.methods.directpost import direct_post -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.Zuul.utils import safe_hasattr # number of seconds between metrics updates diff --git a/Products/ZenCollector/configcache/app/config.py b/Products/ZenCollector/configcache/app/config.py index b7cba77f85..868f5c7643 100644 --- a/Products/ZenCollector/configcache/app/config.py +++ b/Products/ZenCollector/configcache/app/config.py @@ -11,7 +11,7 @@ from Products.ZenUtils.config import Config, ConfigLoader from Products.ZenUtils.GlobalConfig import getGlobalConfiguration -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath def add_config_arguments(parser): diff --git a/Products/ZenCollector/configcache/app/logger.py b/Products/ZenCollector/configcache/app/logger.py index ef79e4b600..65c7fa03db 100644 --- a/Products/ZenCollector/configcache/app/logger.py +++ b/Products/ZenCollector/configcache/app/logger.py @@ -17,7 +17,7 @@ import os import signal -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath _default_config_template = { "version": 1, diff --git a/Products/ZenCollector/configcache/app/pid.py b/Products/ZenCollector/configcache/app/pid.py index 02effb5723..d6ce320329 100644 --- a/Products/ZenCollector/configcache/app/pid.py +++ b/Products/ZenCollector/configcache/app/pid.py @@ -15,7 +15,7 @@ import logging import os -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.pid") diff --git a/Products/ZenCollector/configcache/app/zodb.py b/Products/ZenCollector/configcache/app/zodb.py index 8f90bbf4db..7e2c6ede5b 100644 --- a/Products/ZenCollector/configcache/app/zodb.py +++ b/Products/ZenCollector/configcache/app/zodb.py @@ -23,7 +23,8 @@ from ZPublisher.BaseRequest import RequestContainer from Products.ZenRelations.ZenPropertyManager import setDescriptors -from Products.ZenUtils.Utils import getObjByPath, zenPath +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import getObjByPath _zodb_config_template = """\ %import relstorage diff --git a/Products/ZenEvents/EventClassInst.py b/Products/ZenEvents/EventClassInst.py index 3082810c95..64c6d87a29 100644 --- a/Products/ZenEvents/EventClassInst.py +++ b/Products/ZenEvents/EventClassInst.py @@ -43,7 +43,7 @@ from Products.ZenUtils.Time import SaveMessage from Products import Zuul from Products.Zuul.interfaces import IInfo -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUtils.daemonconfig import IDaemonConfig from zenoss.protocols.jsonformat import to_dict diff --git a/Products/ZenEvents/tests/sendSnmpPcap.py b/Products/ZenEvents/tests/sendSnmpPcap.py index 6b5e922acf..55be2778c6 100644 --- a/Products/ZenEvents/tests/sendSnmpPcap.py +++ b/Products/ZenEvents/tests/sendSnmpPcap.py @@ -11,7 +11,7 @@ import os import socket -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath def main(): "Run a tcpdump PCAP file to zentrap" diff --git a/Products/ZenEvents/zeneventd.py b/Products/ZenEvents/zeneventd.py index 399032dba7..e34d353924 100644 --- a/Products/ZenEvents/zeneventd.py +++ b/Products/ZenEvents/zeneventd.py @@ -62,7 +62,7 @@ from Products.ZenUtils.daemonconfig import IDaemonConfig from Products.ZenUtils.guid import guid from Products.ZenUtils.MetricReporter import MetricReporter -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUtils.ZCmdBase import ZCmdBase diff --git a/Products/ZenEvents/zeneventdWorkers.py b/Products/ZenEvents/zeneventdWorkers.py index ec63a5b3a7..5042a15c25 100644 --- a/Products/ZenEvents/zeneventdWorkers.py +++ b/Products/ZenEvents/zeneventdWorkers.py @@ -23,7 +23,7 @@ from zenoss.protocols.jsonformat import to_dict from zenoss.protocols.eventlet.amqp import Publishable, getProtobufPubSub from Products.ZenCollector.utils.workers import workersBuildOptions -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from metrology import Metrology diff --git a/Products/ZenEvents/zensendsyslog.py b/Products/ZenEvents/zensendsyslog.py index 07241c3e82..959722aec2 100644 --- a/Products/ZenEvents/zensendsyslog.py +++ b/Products/ZenEvents/zensendsyslog.py @@ -10,7 +10,7 @@ import socket import time -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath defaultInfile = zenPath("log/origsyslog.log") from Products.ZenUtils.CmdBase import CmdBase diff --git a/Products/ZenEvents/zensyslog/loggers.py b/Products/ZenEvents/zensyslog/loggers.py index 5124e5427e..1c7652201e 100644 --- a/Products/ZenEvents/zensyslog/loggers.py +++ b/Products/ZenEvents/zensyslog/loggers.py @@ -12,7 +12,7 @@ import logging import time -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath SYSLOG_DATE_FORMAT = "%b %d %H:%M:%S" SAMPLE_DATE = "Apr 10 15:19:22" diff --git a/Products/ZenEvents/zentestsyslogrules.py b/Products/ZenEvents/zentestsyslogrules.py index c3bd20a0bb..5560b120ce 100755 --- a/Products/ZenEvents/zentestsyslogrules.py +++ b/Products/ZenEvents/zentestsyslogrules.py @@ -18,7 +18,7 @@ from Products.ZenEvents.SyslogProcessing import SyslogProcessor from Products.ZenUtils.CmdBase import CmdBase -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath defaultInfile = zenPath("log/origsyslog.log") # The format of the capture syslog message is: diff --git a/Products/ZenHub/zenhub.py b/Products/ZenHub/zenhub.py index e53441ea43..663c58d0ef 100755 --- a/Products/ZenHub/zenhub.py +++ b/Products/ZenHub/zenhub.py @@ -28,11 +28,8 @@ from Products.ZenEvents.ZenEventClasses import App_Start from Products.ZenMessaging.queuemessaging.interfaces import IEventPublisher from Products.ZenUtils.debugtools import ContinuousProfiler -from Products.ZenUtils.Utils import ( - load_config, - load_config_override, - zenPath, -) +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import load_config, load_config_override from Products.ZenUtils.ZCmdBase import ZCmdBase from Products.ZenHub.interfaces import ( diff --git a/Products/ZenMessaging/queuemessaging/schema.py b/Products/ZenMessaging/queuemessaging/schema.py index d9ed42b0db..0ab1405357 100644 --- a/Products/ZenMessaging/queuemessaging/schema.py +++ b/Products/ZenMessaging/queuemessaging/schema.py @@ -25,7 +25,7 @@ from zope.component import getUtility from Products.ZenUtils.PkgResources import pkg_resources -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath def _loadQjs(pack_path): diff --git a/Products/ZenModel/DataRoot.py b/Products/ZenModel/DataRoot.py index ed8ab0e8d3..e1a97561be 100644 --- a/Products/ZenModel/DataRoot.py +++ b/Products/ZenModel/DataRoot.py @@ -42,7 +42,8 @@ import sys import string from Products.ZenMessaging.audit import audit -from Products.ZenUtils.Utils import zenPath, binPath, unpublished +from Products.ZenUtils.path import binPath, zenPath +from Products.ZenUtils.Utils import unpublished from Products.ZenUtils.jsonutils import json from Products.ZenUtils.ZenTales import talesCompile, getEngine from Products.ZenUtils.GlobalConfig import globalConfToDict diff --git a/Products/ZenModel/IpNetwork.py b/Products/ZenModel/IpNetwork.py index d003d47b88..5d2fe97eb4 100644 --- a/Products/ZenModel/IpNetwork.py +++ b/Products/ZenModel/IpNetwork.py @@ -41,10 +41,10 @@ from Products.ZenModel.Exceptions import * +from Products.ZenUtils.path import binPath from Products.ZenUtils.Utils import isXmlRpc, setupLoggingHeader, executeCommand -from Products.ZenUtils.Utils import binPath, clearWebLoggingStream from Products.ZenUtils import NetworkTree -from Products.ZenUtils.Utils import unused, zenPath, unpublished, edgesToXML +from Products.ZenUtils.Utils import unused, unpublished, edgesToXML from Products.Jobber.jobs import SubprocessJob from Products.ZenWidgets import messaging diff --git a/Products/ZenModel/MibOrganizer.py b/Products/ZenModel/MibOrganizer.py index 265d9308d1..31a234204e 100644 --- a/Products/ZenModel/MibOrganizer.py +++ b/Products/ZenModel/MibOrganizer.py @@ -21,7 +21,8 @@ from Products.ZenRelations.RelSchema import ToOne, ToManyCont from Products.ZenUtils.Search import makeCaseInsensitiveKeywordIndex from Products.ZenWidgets import messaging -from Products.ZenUtils.Utils import atomicWrite, binPath, zenPath +from Products.ZenUtils.path import binPath, zenPath +from Products.ZenUtils.Utils import atomicWrite from .MibModule import MibModule from .Organizer import Organizer diff --git a/Products/ZenModel/PerformanceConf.py b/Products/ZenModel/PerformanceConf.py index 94037bd0f8..50ca2c3abf 100644 --- a/Products/ZenModel/PerformanceConf.py +++ b/Products/ZenModel/PerformanceConf.py @@ -33,7 +33,8 @@ from Products.Jobber.jobs import SubprocessJob from Products.ZenRelations.RelSchema import ToMany, ToOne from Products.ZenUtils.deprecated import deprecated -from Products.ZenUtils.Utils import binPath, unused, isXmlRpc, executeCommand +from Products.ZenUtils.path import binPath +from Products.ZenUtils.Utils import unused, isXmlRpc, executeCommand from Products.ZenUtils.GlobalConfig import getGlobalConfiguration from Products.ZenModel.ZDeviceLoader import CreateDeviceJob from Products.ZenWidgets import messaging diff --git a/Products/ZenModel/RRDDataSource.py b/Products/ZenModel/RRDDataSource.py index d23d4b27a0..dd7579b5f8 100644 --- a/Products/ZenModel/RRDDataSource.py +++ b/Products/ZenModel/RRDDataSource.py @@ -8,7 +8,7 @@ ############################################################################## -from Products.ZenUtils.Utils import binPath +from Products.ZenUtils.path import binPath __doc__="""RRDDataSource diff --git a/Products/ZenModel/ZenModelBase.py b/Products/ZenModel/ZenModelBase.py index 5fc8e3cd85..cf561d6a7a 100644 --- a/Products/ZenModel/ZenModelBase.py +++ b/Products/ZenModel/ZenModelBase.py @@ -35,7 +35,8 @@ from Products.ZenModel.interfaces import IZenDocProvider from Products.ZenRelations.ZenPropertyManager import iscustprop -from Products.ZenUtils.Utils import zenpathsplit, zenpathjoin, getDisplayType +from Products.ZenUtils.path import zenpathjoin, zenpathsplit +from Products.ZenUtils.Utils import getDisplayType from Products.ZenUtils.Utils import createHierarchyObj, getHierarchyObj from Products.ZenUtils.Utils import getObjByPath, unpublished diff --git a/Products/ZenModel/ZenModelRM.py b/Products/ZenModel/ZenModelRM.py index ee639f3a1d..983095e84e 100644 --- a/Products/ZenModel/ZenModelRM.py +++ b/Products/ZenModel/ZenModelRM.py @@ -28,7 +28,8 @@ from ZenModelBase import ZenModelBase, iscustprop from ZenPacker import ZenPacker from Products.ZenWidgets import messaging -from Products.ZenUtils.Utils import getSubObjects, zenPath +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import getSubObjects from Products.ZenRelations.ImportRM import ImportRM from Products.ZenRelations.RelationshipManager import RelationshipManager from Products.ZenModel.ZenossSecurity import ( diff --git a/Products/ZenModel/ZenPack.py b/Products/ZenModel/ZenPack.py index 3917daab0c..c38240e393 100644 --- a/Products/ZenModel/ZenPack.py +++ b/Products/ZenModel/ZenPack.py @@ -31,7 +31,8 @@ from AccessControl.class_init import InitializeClass from Products.ZenModel.ZenModelRM import ZenModelRM from Products.ZenRelations.RelSchema import * -from Products.ZenUtils.Utils import importClass, zenPath, varPath +from Products.ZenUtils.path import varPath, zenPath +from Products.ZenUtils.Utils import importClass from Products.ZenUtils.Version import getVersionTupleFromString from Products.ZenUtils.Version import Version as VersionBase from Products.ZenUtils.PkgResources import pkg_resources diff --git a/Products/ZenModel/ZenPackLoader.py b/Products/ZenModel/ZenPackLoader.py index 5a74c88621..2f0ab73cac 100644 --- a/Products/ZenModel/ZenPackLoader.py +++ b/Products/ZenModel/ZenPackLoader.py @@ -12,7 +12,7 @@ from Products.ZenReports.ReportLoader import ReportLoader from Products.ZenUtils.events import pausedAndOptimizedIndexing -from Products.ZenUtils.Utils import zenPath, binPath +from Products.ZenUtils.path import binPath, zenPath from Products.ZenUtils.guid.interfaces import IGUIDManager from Products.ZenUtils.config import ConfigFile from Products.Zuul import getFacade diff --git a/Products/ZenModel/ZenPackManager.py b/Products/ZenModel/ZenPackManager.py index 611b0f8251..282b32cd88 100644 --- a/Products/ZenModel/ZenPackManager.py +++ b/Products/ZenModel/ZenPackManager.py @@ -18,7 +18,7 @@ from AccessControl import ClassSecurityInfo from Products.ZenMessaging.audit import audit from Products.ZenUtils.csrf import validate_csrf_token -from Products.ZenUtils.Utils import binPath, varPath +from Products.ZenUtils.path import binPath, varPath from Products.ZenWidgets import messaging import os import tempfile diff --git a/Products/ZenModel/ZenossInfo.py b/Products/ZenModel/ZenossInfo.py index 1164ff08ee..8e76a541e4 100644 --- a/Products/ZenModel/ZenossInfo.py +++ b/Products/ZenModel/ZenossInfo.py @@ -31,7 +31,7 @@ from Products.ZenUtils.GlobalConfig import getGlobalConfiguration from Products.ZenUtils.Version import (Version, VersionNotSupported, getVersionTupleFromString) -from Products.ZenUtils.Utils import zenPath, binPath, isZenBinFile +from Products.ZenUtils.path import binPath, isZenBinFile, zenPath from Products.ZenWidgets import messaging from Products.ZenMessaging.audit import audit from Products.ZenModel.ZenossSecurity import ( diff --git a/Products/ZenModel/migrate/Migrate.py b/Products/ZenModel/migrate/Migrate.py index ac32eae76a..8bec9e34e3 100644 --- a/Products/ZenModel/migrate/Migrate.py +++ b/Products/ZenModel/migrate/Migrate.py @@ -21,7 +21,7 @@ from Products.ZenUtils.ZenScriptBase import ZenScriptBase from Products.ZenUtils.Version import Version as VersionBase from Products.ZenReports.ReportLoader import ReportLoader -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenModel.ZVersion import VERSION from Products.ZenUtils.terminal_size import get_terminal_size diff --git a/Products/ZenModel/migrate/addMariaDBLogFilters.py b/Products/ZenModel/migrate/addMariaDBLogFilters.py index a5691420e7..1b61bdf545 100644 --- a/Products/ZenModel/migrate/addMariaDBLogFilters.py +++ b/Products/ZenModel/migrate/addMariaDBLogFilters.py @@ -12,7 +12,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/addNginxLogFilters.py b/Products/ZenModel/migrate/addNginxLogFilters.py index 6b0a05524f..964391dad1 100644 --- a/Products/ZenModel/migrate/addNginxLogFilters.py +++ b/Products/ZenModel/migrate/addNginxLogFilters.py @@ -13,7 +13,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/addOpenTSDBLogbackConfig.py b/Products/ZenModel/migrate/addOpenTSDBLogbackConfig.py index 4635f70ab1..499348273c 100644 --- a/Products/ZenModel/migrate/addOpenTSDBLogbackConfig.py +++ b/Products/ZenModel/migrate/addOpenTSDBLogbackConfig.py @@ -12,7 +12,7 @@ log = logging.getLogger("zen.migrate") import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import servicemigration as sm sm.require("1.0.0") diff --git a/Products/ZenModel/migrate/addRabbitMQGlobalConf.py b/Products/ZenModel/migrate/addRabbitMQGlobalConf.py index d39ed27859..b147d88432 100644 --- a/Products/ZenModel/migrate/addRabbitMQGlobalConf.py +++ b/Products/ZenModel/migrate/addRabbitMQGlobalConf.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.5") diff --git a/Products/ZenModel/migrate/addRabbitMQLogFilters.py b/Products/ZenModel/migrate/addRabbitMQLogFilters.py index edc29706f0..7cc8fe0875 100644 --- a/Products/ZenModel/migrate/addRabbitMQLogFilters.py +++ b/Products/ZenModel/migrate/addRabbitMQLogFilters.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.10") diff --git a/Products/ZenModel/migrate/addRedisLogFilters.py b/Products/ZenModel/migrate/addRedisLogFilters.py index 4c175aa274..d1d6fe3a48 100644 --- a/Products/ZenModel/migrate/addRedisLogFilters.py +++ b/Products/ZenModel/migrate/addRedisLogFilters.py @@ -13,7 +13,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/addSolrService.py b/Products/ZenModel/migrate/addSolrService.py index 91ff480fe8..6ced94fbfa 100644 --- a/Products/ZenModel/migrate/addSolrService.py +++ b/Products/ZenModel/migrate/addSolrService.py @@ -16,7 +16,7 @@ import servicemigration as sm sm.require("1.1.11") from servicemigration import HealthCheck -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class AddSolrService(Migrate.Step): """ diff --git a/Products/ZenModel/migrate/addThebeLogFilters.py b/Products/ZenModel/migrate/addThebeLogFilters.py index e0e29153a2..ada589dde9 100644 --- a/Products/ZenModel/migrate/addThebeLogFilters.py +++ b/Products/ZenModel/migrate/addThebeLogFilters.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.10") diff --git a/Products/ZenModel/migrate/addZeneventserverstdioLogFilters.py b/Products/ZenModel/migrate/addZeneventserverstdioLogFilters.py index f6ee6ae63d..d92db9117c 100644 --- a/Products/ZenModel/migrate/addZeneventserverstdioLogFilters.py +++ b/Products/ZenModel/migrate/addZeneventserverstdioLogFilters.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.10") diff --git a/Products/ZenModel/migrate/addZookeeperLogFilters.py b/Products/ZenModel/migrate/addZookeeperLogFilters.py index 65d2e30df5..9c7cc30f0d 100644 --- a/Products/ZenModel/migrate/addZookeeperLogFilters.py +++ b/Products/ZenModel/migrate/addZookeeperLogFilters.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.10") diff --git a/Products/ZenModel/migrate/betterstandarderrormessage.py b/Products/ZenModel/migrate/betterstandarderrormessage.py index 8dfe2680f2..56dc0a7a42 100644 --- a/Products/ZenModel/migrate/betterstandarderrormessage.py +++ b/Products/ZenModel/migrate/betterstandarderrormessage.py @@ -17,7 +17,7 @@ __version__ = "$Revision$"[11:-2] import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class BetterStandardErrorMessage(Migrate.Step): version = Migrate.Version(1, 1, 0) diff --git a/Products/ZenModel/migrate/command.py b/Products/ZenModel/migrate/command.py index 12aa30293f..286acea056 100644 --- a/Products/ZenModel/migrate/command.py +++ b/Products/ZenModel/migrate/command.py @@ -27,7 +27,7 @@ def update(self, dmd, oldname, name, default, **kw): dmd.Devices._setProperty(name, default, **kw) def cutover(self, dmd): - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath self.update(dmd, "zNagiosPath", "zCommandPath", zenPath('libexec')) if dmd.Devices.hasProperty("zNagiosCycleTime"): dmd.Devices._delProperty("zNagiosCycleTime") diff --git a/Products/ZenModel/migrate/datapoints.py b/Products/ZenModel/migrate/datapoints.py index 37396b101b..94137d44e6 100644 --- a/Products/ZenModel/migrate/datapoints.py +++ b/Products/ZenModel/migrate/datapoints.py @@ -66,7 +66,7 @@ def cutoverDataSource(self, s): s.datapoints._setObject(p.id, p) def cutoverTemplate(self, t, rrdPath): - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath oldbase = zenPath('perf') for s in t.datasources()[:]: self.cutoverDataSource(s) diff --git a/Products/ZenModel/migrate/evenbettererstandarderrormessage.py b/Products/ZenModel/migrate/evenbettererstandarderrormessage.py index 5c9fdeb20d..e274693fb7 100644 --- a/Products/ZenModel/migrate/evenbettererstandarderrormessage.py +++ b/Products/ZenModel/migrate/evenbettererstandarderrormessage.py @@ -15,7 +15,7 @@ ''' import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class EvenBettererStandardErrorMessage(Migrate.Step): version = Migrate.Version(2, 1, 1) diff --git a/Products/ZenModel/migrate/evenbetterstandarderrormessage.py b/Products/ZenModel/migrate/evenbetterstandarderrormessage.py index 210c8579b3..031a074d2c 100644 --- a/Products/ZenModel/migrate/evenbetterstandarderrormessage.py +++ b/Products/ZenModel/migrate/evenbetterstandarderrormessage.py @@ -15,7 +15,7 @@ ''' import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class EvenBetterStandardErrorMessage(Migrate.Step): version = Migrate.Version(2, 0, 0) diff --git a/Products/ZenModel/migrate/evenmorebettererstandarderrormessage.py b/Products/ZenModel/migrate/evenmorebettererstandarderrormessage.py index dc09cfb3d5..bb2fecca2a 100644 --- a/Products/ZenModel/migrate/evenmorebettererstandarderrormessage.py +++ b/Products/ZenModel/migrate/evenmorebettererstandarderrormessage.py @@ -15,7 +15,7 @@ ''' import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class EvenMoreBettererStandardErrorMessage(Migrate.Step): version = Migrate.Version(2, 3, 0) diff --git a/Products/ZenModel/migrate/fixHbaseLogFilters.py b/Products/ZenModel/migrate/fixHbaseLogFilters.py index 0a2a3128de..a757235f8c 100644 --- a/Products/ZenModel/migrate/fixHbaseLogFilters.py +++ b/Products/ZenModel/migrate/fixHbaseLogFilters.py @@ -13,7 +13,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/fixMetricShipperLogFilters.py b/Products/ZenModel/migrate/fixMetricShipperLogFilters.py index b18c7d927b..c352839876 100644 --- a/Products/ZenModel/migrate/fixMetricShipperLogFilters.py +++ b/Products/ZenModel/migrate/fixMetricShipperLogFilters.py @@ -13,7 +13,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/fixOpentsdbLogFilters.py b/Products/ZenModel/migrate/fixOpentsdbLogFilters.py index 5caf6138f8..ec739b63cf 100644 --- a/Products/ZenModel/migrate/fixOpentsdbLogFilters.py +++ b/Products/ZenModel/migrate/fixOpentsdbLogFilters.py @@ -13,7 +13,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/fixZminionLogFilters.py b/Products/ZenModel/migrate/fixZminionLogFilters.py index ee91691a5e..2fc2da4e96 100644 --- a/Products/ZenModel/migrate/fixZminionLogFilters.py +++ b/Products/ZenModel/migrate/fixZminionLogFilters.py @@ -13,7 +13,7 @@ import logging log = logging.getLogger("zen.migrate") -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import Migrate import servicemigration as sm diff --git a/Products/ZenModel/migrate/hoist_perf_data.py b/Products/ZenModel/migrate/hoist_perf_data.py index 6d3710e443..1f22811587 100644 --- a/Products/ZenModel/migrate/hoist_perf_data.py +++ b/Products/ZenModel/migrate/hoist_perf_data.py @@ -32,7 +32,7 @@ def __init__(self): def cutover(self, dmd): names = dmd.getDmdRoot('Devices').getOrganizerNames(True) - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath oldbase = zenPath('perf', 'Devices') names.sort() names.reverse() diff --git a/Products/ZenModel/migrate/import_export_filesystem.py b/Products/ZenModel/migrate/import_export_filesystem.py index fee4adbee9..b457cb9fb7 100644 --- a/Products/ZenModel/migrate/import_export_filesystem.py +++ b/Products/ZenModel/migrate/import_export_filesystem.py @@ -21,7 +21,7 @@ import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class ImportExportFilesystem(Migrate.Step): version = Migrate.Version(0, 23, 0) diff --git a/Products/ZenModel/migrate/kill_cricket.py b/Products/ZenModel/migrate/kill_cricket.py index 76dbbd5e09..17150e09f8 100644 --- a/Products/ZenModel/migrate/kill_cricket.py +++ b/Products/ZenModel/migrate/kill_cricket.py @@ -22,7 +22,7 @@ import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class KillCricket(Migrate.Step): version = Migrate.Version(0, 20, 0) diff --git a/Products/ZenModel/migrate/menus.py b/Products/ZenModel/migrate/menus.py index d63fed8980..b69aa0f488 100644 --- a/Products/ZenModel/migrate/menus.py +++ b/Products/ZenModel/migrate/menus.py @@ -17,7 +17,7 @@ ''' import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath menuxml = zenPath("Products/ZenModel/data/menus.xml") ZenPackItems = dict( diff --git a/Products/ZenModel/migrate/monitorTemplateMenu.py b/Products/ZenModel/migrate/monitorTemplateMenu.py index 0b7eceea25..bdc9011253 100644 --- a/Products/ZenModel/migrate/monitorTemplateMenu.py +++ b/Products/ZenModel/migrate/monitorTemplateMenu.py @@ -37,7 +37,7 @@ def cutover(self, dmd): dmd.Monitors.buildRelations() if len(dmd.Monitors.rrdTemplates()) == 0: from Products.ZenRelations.ImportRM import ImportRM - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath template = zenPath('Products/ZenModel/migrate/monitorTemplate.xml') im = ImportRM(noopts=True, app=dmd.zport) im.loadObjectFromXML(xmlfile=template) diff --git a/Products/ZenModel/migrate/moveZepConfig.py b/Products/ZenModel/migrate/moveZepConfig.py index c38699949a..8ed8e1383b 100644 --- a/Products/ZenModel/migrate/moveZepConfig.py +++ b/Products/ZenModel/migrate/moveZepConfig.py @@ -13,7 +13,7 @@ """ import os import logging -from Products.ZenUtils.Utils import unused, zenPath +from Products.ZenUtils.path import zenPath from Products.ZenModel.migrate import Migrate from Products.Zuul import getFacade diff --git a/Products/ZenModel/migrate/nginxConfigForZauth.py b/Products/ZenModel/migrate/nginxConfigForZauth.py index 71bfc414a5..153e705806 100644 --- a/Products/ZenModel/migrate/nginxConfigForZauth.py +++ b/Products/ZenModel/migrate/nginxConfigForZauth.py @@ -4,7 +4,7 @@ import re import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.0.0") diff --git a/Products/ZenModel/migrate/pagecommand.py b/Products/ZenModel/migrate/pagecommand.py index e0a41241ea..f8ee4422b0 100644 --- a/Products/ZenModel/migrate/pagecommand.py +++ b/Products/ZenModel/migrate/pagecommand.py @@ -39,7 +39,7 @@ def parseconfig(options): class OptionsBucket: pass -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class pagecommand(Migrate.Step): version = Migrate.Version(2, 2, 0) diff --git a/Products/ZenModel/migrate/processes.py b/Products/ZenModel/migrate/processes.py index beb953059f..02813b8faa 100644 --- a/Products/ZenModel/migrate/processes.py +++ b/Products/ZenModel/migrate/processes.py @@ -17,7 +17,7 @@ __version__ = "$Revision$"[11:-2] import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Processes(Migrate.Step): version = Migrate.Version(0, 22, 0) diff --git a/Products/ZenModel/migrate/procparams.py b/Products/ZenModel/migrate/procparams.py index 08e130bb67..94055c0cb8 100644 --- a/Products/ZenModel/migrate/procparams.py +++ b/Products/ZenModel/migrate/procparams.py @@ -14,7 +14,7 @@ ''' import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import os diff --git a/Products/ZenModel/migrate/removeClearHeartbeatsMenuItem.py b/Products/ZenModel/migrate/removeClearHeartbeatsMenuItem.py index f7e26a4cb5..87d16cfeb0 100644 --- a/Products/ZenModel/migrate/removeClearHeartbeatsMenuItem.py +++ b/Products/ZenModel/migrate/removeClearHeartbeatsMenuItem.py @@ -13,7 +13,6 @@ """ import os import logging -from Products.ZenUtils.Utils import unused, zenPath from Products.ZenModel.migrate import Migrate from Products.Zuul import getFacade diff --git a/Products/ZenModel/migrate/smtpsnpp.py b/Products/ZenModel/migrate/smtpsnpp.py index b8923b1b2c..665b06f7a8 100644 --- a/Products/ZenModel/migrate/smtpsnpp.py +++ b/Products/ZenModel/migrate/smtpsnpp.py @@ -38,7 +38,7 @@ def parseconfig(options): class OptionsBucket: pass -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class smtpsnpp(Migrate.Step): version = Migrate.Version(1, 0, 0) diff --git a/Products/ZenModel/migrate/standarderrormessage.py b/Products/ZenModel/migrate/standarderrormessage.py index c76117e8cc..796e4da85b 100644 --- a/Products/ZenModel/migrate/standarderrormessage.py +++ b/Products/ZenModel/migrate/standarderrormessage.py @@ -17,7 +17,7 @@ __version__ = "$Revision$"[11:-2] import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class StandardErrorMessage(Migrate.Step): version = Migrate.Version(0, 23, 0) diff --git a/Products/ZenModel/migrate/tests/test_addMariaDBLogFilters.py b/Products/ZenModel/migrate/tests/test_addMariaDBLogFilters.py index d7e159307e..f251ff2c3e 100644 --- a/Products/ZenModel/migrate/tests/test_addMariaDBLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addMariaDBLogFilters.py @@ -3,7 +3,7 @@ import unittest import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_addMariaDBLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): """ diff --git a/Products/ZenModel/migrate/tests/test_addNginxLogFilters.py b/Products/ZenModel/migrate/tests/test_addNginxLogFilters.py index 42599add0e..9d25af1b6e 100644 --- a/Products/ZenModel/migrate/tests/test_addNginxLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addNginxLogFilters.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_addRedisLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_addRabbitMQLogFilters.py b/Products/ZenModel/migrate/tests/test_addRabbitMQLogFilters.py index 95988ba153..82fa5b40fd 100644 --- a/Products/ZenModel/migrate/tests/test_addRabbitMQLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addRabbitMQLogFilters.py @@ -9,7 +9,7 @@ import common import unittest -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class test_addRabbitMQLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): """ diff --git a/Products/ZenModel/migrate/tests/test_addRedisLogFilters.py b/Products/ZenModel/migrate/tests/test_addRedisLogFilters.py index 796db4c925..a73042638c 100644 --- a/Products/ZenModel/migrate/tests/test_addRedisLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addRedisLogFilters.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_addRedisLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_addSolrService.py b/Products/ZenModel/migrate/tests/test_addSolrService.py index a371b1c245..1bde89f78f 100644 --- a/Products/ZenModel/migrate/tests/test_addSolrService.py +++ b/Products/ZenModel/migrate/tests/test_addSolrService.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_addSolrService(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_addThebeLogFilters.py b/Products/ZenModel/migrate/tests/test_addThebeLogFilters.py index 91b12b9809..78cc591a49 100644 --- a/Products/ZenModel/migrate/tests/test_addThebeLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addThebeLogFilters.py @@ -9,7 +9,7 @@ import common import unittest -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class test_addThebeLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): """ diff --git a/Products/ZenModel/migrate/tests/test_addZeneventserverstdioLogFilters.py b/Products/ZenModel/migrate/tests/test_addZeneventserverstdioLogFilters.py index 48297777d1..1155f7179d 100644 --- a/Products/ZenModel/migrate/tests/test_addZeneventserverstdioLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addZeneventserverstdioLogFilters.py @@ -9,7 +9,7 @@ import common import unittest -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class test_addZeneventserverstdioLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): """ diff --git a/Products/ZenModel/migrate/tests/test_addZookeeperLogFilters.py b/Products/ZenModel/migrate/tests/test_addZookeeperLogFilters.py index 9884e38307..9b0961ede1 100644 --- a/Products/ZenModel/migrate/tests/test_addZookeeperLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_addZookeeperLogFilters.py @@ -9,7 +9,7 @@ import common import unittest -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class test_addZookeeperLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): """ diff --git a/Products/ZenModel/migrate/tests/test_fixHbaseLogFilters.py b/Products/ZenModel/migrate/tests/test_fixHbaseLogFilters.py index c4e54acb31..56cb255104 100644 --- a/Products/ZenModel/migrate/tests/test_fixHbaseLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_fixHbaseLogFilters.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_fixHbaseLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_fixMetricShipperLogFilters.py b/Products/ZenModel/migrate/tests/test_fixMetricShipperLogFilters.py index d38a1d378f..ee2e64d76d 100644 --- a/Products/ZenModel/migrate/tests/test_fixMetricShipperLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_fixMetricShipperLogFilters.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_fixMetricShipperLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_fixOpentsdbLogFilters.py b/Products/ZenModel/migrate/tests/test_fixOpentsdbLogFilters.py index 1654da5cee..e6c29fd2eb 100644 --- a/Products/ZenModel/migrate/tests/test_fixOpentsdbLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_fixOpentsdbLogFilters.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_fixOpentsdbLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_fixZminionLogFilters.py b/Products/ZenModel/migrate/tests/test_fixZminionLogFilters.py index 28e8dfe315..c3aacbb079 100644 --- a/Products/ZenModel/migrate/tests/test_fixZminionLogFilters.py +++ b/Products/ZenModel/migrate/tests/test_fixZminionLogFilters.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_fixZminionLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/tests/test_updateRegionServerGraphs.py b/Products/ZenModel/migrate/tests/test_updateRegionServerGraphs.py index baba184c4a..b286b159e9 100644 --- a/Products/ZenModel/migrate/tests/test_updateRegionServerGraphs.py +++ b/Products/ZenModel/migrate/tests/test_updateRegionServerGraphs.py @@ -5,7 +5,7 @@ import common -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Test_updateRegionServerGraphs(unittest.TestCase, common.ServiceMigrationTestCase): diff --git a/Products/ZenModel/migrate/twopointohobjects.py b/Products/ZenModel/migrate/twopointohobjects.py index 7ecb6bafb2..18bd09feb8 100644 --- a/Products/ZenModel/migrate/twopointohobjects.py +++ b/Products/ZenModel/migrate/twopointohobjects.py @@ -35,7 +35,7 @@ def _loopback(self, dmd): dmd.Devices.manage_addRRDTemplate('softwareLoopback') def _zCommandPath(self, dmd): - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath dmd.Devices.zCommandPath = zenPath('libexec') def _cleanupClass(self, dmd): diff --git a/Products/ZenModel/migrate/updateOpenTSDBOriginalConfig.py b/Products/ZenModel/migrate/updateOpenTSDBOriginalConfig.py index 9d1f1ca73c..8a66cd7d65 100644 --- a/Products/ZenModel/migrate/updateOpenTSDBOriginalConfig.py +++ b/Products/ZenModel/migrate/updateOpenTSDBOriginalConfig.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.5") diff --git a/Products/ZenModel/migrate/updateSolrConfigs.py b/Products/ZenModel/migrate/updateSolrConfigs.py index eb4445f7c9..c832e04a34 100644 --- a/Products/ZenModel/migrate/updateSolrConfigs.py +++ b/Products/ZenModel/migrate/updateSolrConfigs.py @@ -14,7 +14,7 @@ import logging import Migrate import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") diff --git a/Products/ZenModel/migrate/updateZeneventserverstdioLogPaths.py b/Products/ZenModel/migrate/updateZeneventserverstdioLogPaths.py index 1cebc04ad1..9c1db7eb4b 100644 --- a/Products/ZenModel/migrate/updateZeneventserverstdioLogPaths.py +++ b/Products/ZenModel/migrate/updateZeneventserverstdioLogPaths.py @@ -11,7 +11,7 @@ import Migrate import os import servicemigration as sm -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.migrate") sm.require("1.1.10") diff --git a/Products/ZenModel/migrate/winmodelerUnderModeler.py b/Products/ZenModel/migrate/winmodelerUnderModeler.py index 4db33ab418..f491d78c6d 100644 --- a/Products/ZenModel/migrate/winmodelerUnderModeler.py +++ b/Products/ZenModel/migrate/winmodelerUnderModeler.py @@ -16,7 +16,7 @@ class WinModelerUnderModeler(Migrate.Step): def cutover(self, dmd): import os - from Products.ZenUtils.Utils import binPath + from Products.ZenUtils.path import binPath os.system('%s stop >/dev/null 2>&1' % binPath('zenwinmodeler')) conn = dmd.ZenEventManager.connect() curr = conn.cursor() diff --git a/Products/ZenModel/migrate/zpsitecustomize.py b/Products/ZenModel/migrate/zpsitecustomize.py index eebda2131f..53cf4fea28 100644 --- a/Products/ZenModel/migrate/zpsitecustomize.py +++ b/Products/ZenModel/migrate/zpsitecustomize.py @@ -12,7 +12,7 @@ ''' import Migrate -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class zpSiteCustomize(Migrate.Step): version = Migrate.Version(2, 2, 0) diff --git a/Products/ZenModel/tests/testImport.py b/Products/ZenModel/tests/testImport.py index c3028061c1..7e7385444f 100644 --- a/Products/ZenModel/tests/testImport.py +++ b/Products/ZenModel/tests/testImport.py @@ -14,7 +14,7 @@ class TestImportEverything(BaseTestCase): def testImportEverything(self): import os - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath modules = ['ZenModel', 'ZenRelations', 'ZenRRD', 'ZenUtils', 'ZenEvents', 'ZenHub'] for module in modules: diff --git a/Products/ZenModel/zenbuild.py b/Products/ZenModel/zenbuild.py index f61c8505ca..eec28fa4df 100644 --- a/Products/ZenModel/zenbuild.py +++ b/Products/ZenModel/zenbuild.py @@ -22,7 +22,7 @@ import subprocess import sys -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUtils import Security from Products.ZenUtils.CmdBase import CmdBase diff --git a/Products/ZenModel/zendmd.py b/Products/ZenModel/zendmd.py index eda5cb5e44..51b0739ff6 100644 --- a/Products/ZenModel/zendmd.py +++ b/Products/ZenModel/zendmd.py @@ -86,7 +86,8 @@ from Products.CMFCore.utils import getToolByName from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import noSecurityManager -from Products.ZenUtils.Utils import zenPath, set_context +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import set_context from Products.ZenModel.IpNetwork import IpNetworkPrinterFactory from Products.ZenMessaging import audit from Products.Zuul.utils import safe_hasattr diff --git a/Products/ZenModel/zenmib.py b/Products/ZenModel/zenmib.py index d69c177e99..1105847ce9 100644 --- a/Products/ZenModel/zenmib.py +++ b/Products/ZenModel/zenmib.py @@ -62,7 +62,7 @@ PackageManager, SMIConfigFile, SMIDump, SMIDumpTool, ModuleManager, MibOrganizerPath, getMibModuleMap, MIBLoader ) -from Products.ZenUtils.Utils import zenPath, unused +from Products.ZenUtils.path import zenPath diff --git a/Products/ZenRRD/tests/testzenprocess.py b/Products/ZenRRD/tests/testzenprocess.py index bf7a2fd9e8..3d3f78c0fe 100644 --- a/Products/ZenRRD/tests/testzenprocess.py +++ b/Products/ZenRRD/tests/testzenprocess.py @@ -17,7 +17,7 @@ from Products.ZenHub.services.ProcessConfig import ProcessProxy from Products.ZenRRD.zenprocess import mapResultsToDicts, ZenProcessTask -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.testzenprocess") diff --git a/Products/ZenRelations/schemadoc.py b/Products/ZenRelations/schemadoc.py index d45a8fcc59..c72a458b37 100644 --- a/Products/ZenRelations/schemadoc.py +++ b/Products/ZenRelations/schemadoc.py @@ -13,7 +13,7 @@ import sys from Products.ZenRelations.utils import importClasses -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath logging.basicConfig() root = logging.getLogger() diff --git a/Products/ZenRelations/tests/testImport.py b/Products/ZenRelations/tests/testImport.py index c19d207400..1ea55b984a 100644 --- a/Products/ZenRelations/tests/testImport.py +++ b/Products/ZenRelations/tests/testImport.py @@ -15,7 +15,7 @@ class TestImportEverything(BaseTestCase): def testImportEverything(self): import os - from Products.ZenUtils.Utils import zenPath + from Products.ZenUtils.path import zenPath for fs, ds, d in os.walk(zenPath("Products", self.module)): for f in fs: diff --git a/Products/ZenReports/ReportLoader.py b/Products/ZenReports/ReportLoader.py index 1216371352..b3a07c53dc 100644 --- a/Products/ZenReports/ReportLoader.py +++ b/Products/ZenReports/ReportLoader.py @@ -19,7 +19,7 @@ import logging from Products.ZenUtils.ZCmdBase import ZCmdBase -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenModel.Report import Report diff --git a/Products/ZenReports/ReportServer.py b/Products/ZenReports/ReportServer.py index ee4b6a4620..f475bc2309 100644 --- a/Products/ZenReports/ReportServer.py +++ b/Products/ZenReports/ReportServer.py @@ -26,7 +26,8 @@ from Products.ZenModel.ZenModelRM import ZenModelRM from Products.ZenModel.ZenossSecurity import ZEN_COMMON -from Products.ZenUtils.Utils import importClass, zenPath +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import importClass log = logging.getLogger('zen.reportserver') diff --git a/Products/ZenStatus/zenping.py b/Products/ZenStatus/zenping.py index bcb07f11b5..6262e26e4e 100644 --- a/Products/ZenStatus/zenping.py +++ b/Products/ZenStatus/zenping.py @@ -26,7 +26,8 @@ from Products.ZenCollector.daemon import CollectorDaemon from Products.ZenUtils import IpUtil from Products.ZenUtils.FileCache import FileCache -from Products.ZenUtils.Utils import unused, zenPath +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import unused # perform some imports to allow twisted's PB to serialize these objects from Products.ZenCollector.services.config import DeviceProxy diff --git a/Products/ZenUI3/browser/testing.py b/Products/ZenUI3/browser/testing.py index 2c36bab3e9..68e9c1403c 100644 --- a/Products/ZenUI3/browser/testing.py +++ b/Products/ZenUI3/browser/testing.py @@ -11,7 +11,7 @@ log = logging.getLogger('zen.UITests') from Products.Five.browser import BrowserView from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUI3.browser.javascript import getAllZenPackResources diff --git a/Products/ZenUI3/browser/views.py b/Products/ZenUI3/browser/views.py index 4202221e07..e3ec6bf41e 100644 --- a/Products/ZenUI3/browser/views.py +++ b/Products/ZenUI3/browser/views.py @@ -21,7 +21,7 @@ from Products import Zuul from Products.ZenUtils.guid.interfaces import IGUIDManager from Products.ZenUtils.virtual_root import IVirtualRoot -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenModel.DataRoot import DataRoot diff --git a/Products/ZenUtils/CmdBase.py b/Products/ZenUtils/CmdBase.py index e06181f35a..d29cb7515a 100644 --- a/Products/ZenUtils/CmdBase.py +++ b/Products/ZenUtils/CmdBase.py @@ -35,11 +35,11 @@ from Zope2.App import zcml from .config import ConfigLoader +from .path import zenPath from .Utils import ( getAllParserOptionsGen, load_config_override, unused, - zenPath, ) from .GlobalConfig import ( _convertConfigLinesToArguments, diff --git a/Products/ZenUtils/ConfDaemon.py b/Products/ZenUtils/ConfDaemon.py index 29fa1003e4..01b04cc024 100644 --- a/Products/ZenUtils/ConfDaemon.py +++ b/Products/ZenUtils/ConfDaemon.py @@ -23,7 +23,7 @@ import time from CmdBase import CmdBase -from Utils import zenPath +from .path import zenPath class ConfDaemon(CmdBase): diff --git a/Products/ZenUtils/EggifyZenPack.py b/Products/ZenUtils/EggifyZenPack.py index 4123ce769e..580e0829b4 100644 --- a/Products/ZenUtils/EggifyZenPack.py +++ b/Products/ZenUtils/EggifyZenPack.py @@ -10,9 +10,9 @@ __doc__ = "Convert old-style zenpacks to zenpack eggs" +from Pruducts.ZenUtils.path import zenPath from Products.ZenUtils.ZenScriptBase import ZenScriptBase from Products.ZenModel.ZenPack import ZenPackException -from Utils import zenPath import ZenPackCmd import os, sys import shutil diff --git a/Products/ZenUtils/GlobalConfig.py b/Products/ZenUtils/GlobalConfig.py index 6049825086..1b0591da8f 100644 --- a/Products/ZenUtils/GlobalConfig.py +++ b/Products/ZenUtils/GlobalConfig.py @@ -17,7 +17,8 @@ from optparse import OptionValueError, BadOptionError from .config import Config, ConfigLoader -from .Utils import zenPath, getAllParserOptionsGen +from .path import zenPath +from .Utils import getAllParserOptionsGen log = logging.getLogger("zen.GlobalConfig") CONFIG_FILE = zenPath("etc", "global.conf") diff --git a/Products/ZenUtils/RunCommand.py b/Products/ZenUtils/RunCommand.py index a36054b7ac..06f8aa84bd 100755 --- a/Products/ZenUtils/RunCommand.py +++ b/Products/ZenUtils/RunCommand.py @@ -28,7 +28,7 @@ import signal from Products.ZenUtils.ZenScriptBase import ZenScriptBase -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class CollectorStats: diff --git a/Products/ZenUtils/Watchdog.py b/Products/ZenUtils/Watchdog.py index b222ac4067..ef630ab441 100644 --- a/Products/ZenUtils/Watchdog.py +++ b/Products/ZenUtils/Watchdog.py @@ -16,7 +16,7 @@ ''' -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath import logging import socket as s diff --git a/Products/ZenUtils/ZCmdBase.py b/Products/ZenUtils/ZCmdBase.py index 67bdbd96c0..33f16d69fd 100644 --- a/Products/ZenUtils/ZCmdBase.py +++ b/Products/ZenUtils/ZCmdBase.py @@ -25,7 +25,8 @@ from .Exceptions import ZentinelException from .mysql import MySQLdb -from .Utils import getObjByPath, wait, zenPath +from .path import zenPath +from .Utils import getObjByPath, wait from .ZenDaemon import ZenDaemon from .ZodbFactory import IZodbFactoryLookup diff --git a/Products/ZenUtils/ZenBackup.py b/Products/ZenUtils/ZenBackup.py index b0508f26eb..702a8a6de6 100755 --- a/Products/ZenUtils/ZenBackup.py +++ b/Products/ZenUtils/ZenBackup.py @@ -28,7 +28,8 @@ from itertools import imap from ZCmdBase import ZCmdBase -from Products.ZenUtils.Utils import zenPath, binPath, readable_time, unused +from Products.ZenUtils.path import binPath, zenPath +from Products.ZenUtils.Utils import readable_time from ZenBackupBase import * from zope.interface import implements from Products.Zuul.interfaces import IPreBackupEvent, IPostBackupEvent diff --git a/Products/ZenUtils/ZenCheckZenDS.py b/Products/ZenUtils/ZenCheckZenDS.py index 7705740132..9f9b94faaf 100644 --- a/Products/ZenUtils/ZenCheckZenDS.py +++ b/Products/ZenUtils/ZenCheckZenDS.py @@ -19,7 +19,7 @@ from Products.ZenUtils.config import ConfigFile from Products.ZenUtils.configlog import ZenRotatingFileHandler -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath logging.basicConfig(level=logging.INFO) LOG = logging.getLogger("zen.zencheckzends") diff --git a/Products/ZenUtils/ZenDaemon.py b/Products/ZenUtils/ZenDaemon.py index 49b5ad35ea..d72a1b545c 100644 --- a/Products/ZenUtils/ZenDaemon.py +++ b/Products/ZenUtils/ZenDaemon.py @@ -29,7 +29,8 @@ from .CmdBase import CmdBase from .dumpthreads import dump_threads -from .Utils import binPath, HtmlFormatter, setLogLevel, zenPath +from .path import binPath, zenPath +from .Utils import HtmlFormatter, setLogLevel from .Watchdog import Reporter # Daemon creation code below based on Recipe by Chad J. Schroeder diff --git a/Products/ZenUtils/ZenPackCmd.py b/Products/ZenUtils/ZenPackCmd.py index 5ebc0b1f63..9481e01902 100644 --- a/Products/ZenUtils/ZenPackCmd.py +++ b/Products/ZenUtils/ZenPackCmd.py @@ -12,7 +12,8 @@ from ZODB.transact import transact from Products.ZenUtils.ZenScriptBase import ZenScriptBase -from Products.ZenUtils.Utils import cleanupSkins, zenPath, binPath, getObjByPath,atomicWrite, varPath +from Products.ZenUtils.path import binPath, varPath, zenPath +from Products.ZenUtils.Utils import cleanupSkins, getObjByPath, atomicWrite from Products.ZenModel import ZVersion from Products.ZenModel.ZenPack import ZenPackException, \ diff --git a/Products/ZenUtils/ZenPackDaemons.py b/Products/ZenUtils/ZenPackDaemons.py index b680315505..b8de119a22 100644 --- a/Products/ZenUtils/ZenPackDaemons.py +++ b/Products/ZenUtils/ZenPackDaemons.py @@ -19,7 +19,7 @@ from Products.ZenUtils.ZenScriptBase import ZenScriptBase from Products.ZenUtils.ZenPackCmd import ZENPACK_ENTRY_POINT from Products.ZenModel.ZenPackLoader import ZPLDaemons -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class ZenPackDaemons(ZenScriptBase): diff --git a/Products/ZenUtils/ZenRestore.py b/Products/ZenUtils/ZenRestore.py index 48e0e749d4..85cf7d7c73 100755 --- a/Products/ZenUtils/ZenRestore.py +++ b/Products/ZenUtils/ZenRestore.py @@ -22,7 +22,8 @@ import ConfigParser from ZCmdBase import ZCmdBase -from Products.ZenUtils.Utils import zenPath, binPath, requiresDaemonShutdown +from Products.ZenUtils.path import binPath, zenPath +from Products.ZenUtils.Utils import requiresDaemonShutdown from ZenBackupBase import * diff --git a/Products/ZenUtils/ZenScriptBase.py b/Products/ZenUtils/ZenScriptBase.py index 16457ea60c..6c3df9edf6 100644 --- a/Products/ZenUtils/ZenScriptBase.py +++ b/Products/ZenUtils/ZenScriptBase.py @@ -25,7 +25,8 @@ from .CmdBase import CmdBase from .Exceptions import ZentinelException -from .Utils import getObjByPath, set_context, zenPath +from .path import zenPath +from .Utils import getObjByPath, set_context from .ZodbFactory import IZodbFactoryLookup defaultCacheDir = zenPath("var") diff --git a/Products/ZenUtils/configlog.py b/Products/ZenUtils/configlog.py index 2999b8544b..f546965e68 100644 --- a/Products/ZenUtils/configlog.py +++ b/Products/ZenUtils/configlog.py @@ -35,7 +35,7 @@ from logging.handlers import RotatingFileHandler from logging.handlers import TimedRotatingFileHandler -from .Utils import zenPath +from .path import zenPath log = logging.getLogger("zen.configlog") diff --git a/Products/ZenUtils/dbverify.py b/Products/ZenUtils/dbverify.py index 143f2eb8c6..5aacb13552 100755 --- a/Products/ZenUtils/dbverify.py +++ b/Products/ZenUtils/dbverify.py @@ -13,7 +13,7 @@ from optparse import OptionParser import subprocess import re -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class Main(object): diff --git a/Products/ZenUtils/deprecated.py b/Products/ZenUtils/deprecated.py index b16076be9a..b7361d11b8 100644 --- a/Products/ZenUtils/deprecated.py +++ b/Products/ZenUtils/deprecated.py @@ -12,7 +12,7 @@ import logging import traceback from decorator import decorator -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath class DeprecatedLogger(object): diff --git a/Products/ZenUtils/mib/tests/test_smidump.py b/Products/ZenUtils/mib/tests/test_smidump.py index 2108813819..b888449264 100644 --- a/Products/ZenUtils/mib/tests/test_smidump.py +++ b/Products/ZenUtils/mib/tests/test_smidump.py @@ -13,7 +13,7 @@ from subprocess import PIPE from unittest import TestCase -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUtils.mib import SMIConfigFile, SMIDump, SMIDumpTool, MIBFile from Products.ZenUtils.mib import smidump diff --git a/Products/ZenUtils/tbdetail.py b/Products/ZenUtils/tbdetail.py index 5f25fb7f99..7efa043d5d 100644 --- a/Products/ZenUtils/tbdetail.py +++ b/Products/ZenUtils/tbdetail.py @@ -11,7 +11,7 @@ import re import cgitb from cStringIO import StringIO -from Products.ZenUtils.Utils import unused, zenPath +from Products.ZenUtils.path import zenPath _PATTERN = re.compile( diff --git a/Products/ZenUtils/tests/testDeprecated.py b/Products/ZenUtils/tests/testDeprecated.py index 09ef971374..ffa0c8c9c9 100644 --- a/Products/ZenUtils/tests/testDeprecated.py +++ b/Products/ZenUtils/tests/testDeprecated.py @@ -19,7 +19,7 @@ import os.path import Globals from Products.ZenTestCase.BaseTestCase import BaseTestCase -from Products.ZenUtils.Utils import zenPath # TODO: this test shouldn't rely on zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUtils.deprecated import deprecated, DeprecatedLogger TEST_LOGFILE = 'dEpReCaTeD.TeStLoG' # something unique diff --git a/Products/ZenUtils/tests/testFindEggs.py b/Products/ZenUtils/tests/testFindEggs.py index 2e67771edd..6bb19fe5b0 100644 --- a/Products/ZenUtils/tests/testFindEggs.py +++ b/Products/ZenUtils/tests/testFindEggs.py @@ -14,7 +14,7 @@ from Products.ZenTestCase.BaseTestCase import BaseTestCase from Products.ZenUtils.zenpack import ZenPackCmd -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath @contextmanager diff --git a/Products/ZenUtils/zenpack.py b/Products/ZenUtils/zenpack.py index d6b31227d1..8436b98ca5 100644 --- a/Products/ZenUtils/zenpack.py +++ b/Products/ZenUtils/zenpack.py @@ -40,7 +40,8 @@ ZenPackNeedMigrateException ) from Products.ZenUtils.ZenScriptBase import ZenScriptBase -from Products.ZenUtils.Utils import cleanupSkins, zenPath, binPath, varPath, get_temp_dir +from Products.ZenUtils.path import binPath, varPath, zenPath +from Products.ZenUtils.Utils import cleanupSkins, get_temp_dir import Products.ZenModel.ZenPackLoader as ZPL from Products.ZenModel.ZenPackLoader import CONFIG_FILE, CONFIG_SECTION_ABOUT from Products.ZenModel.ZVersion import VERSION diff --git a/Products/ZenWidgets/Portlet.py b/Products/ZenWidgets/Portlet.py index 6fd6af4ec7..92cb2c2118 100644 --- a/Products/ZenWidgets/Portlet.py +++ b/Products/ZenWidgets/Portlet.py @@ -17,7 +17,7 @@ from Products.ZenModel.ZenModelRM import ZenModelRM from Products.ZenModel.ZenossSecurity import ZEN_COMMON from Products.ZenRelations.RelSchema import ToManyCont, ToOne -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath log = logging.getLogger("zen.Portlet") diff --git a/Products/Zuul/facades/mibfacade.py b/Products/Zuul/facades/mibfacade.py index 66f9018b52..bc5cefdd52 100644 --- a/Products/Zuul/facades/mibfacade.py +++ b/Products/Zuul/facades/mibfacade.py @@ -20,7 +20,8 @@ MibOrganizerNode, MibNode, FakeTopLevelNodeInfo ) from Products.Jobber.jobs import SubprocessJob -from Products.ZenUtils.Utils import binPath, snmptranslate +from Products.ZenUtils.path import binPath +from Products.ZenUtils.Utils import snmptranslate from Products.ZenModel.MibOrganizer import MibOrganizer from Products.ZenModel.MibModule import MibModule diff --git a/Products/Zuul/facades/networkfacade.py b/Products/Zuul/facades/networkfacade.py index d34dba3571..ea0acfc0b8 100644 --- a/Products/Zuul/facades/networkfacade.py +++ b/Products/Zuul/facades/networkfacade.py @@ -14,7 +14,7 @@ from Products.ZenModel.IpNetwork import AutoDiscoveryJob from Products.ZenWidgets.messaging import IMessageSender from Products.Jobber.jobs import SubprocessJob -from Products.ZenUtils.Utils import binPath +from Products.ZenUtils.path import binPath from Products.Zuul import getFacade from Products.Zuul.catalog.interfaces import IModelCatalogTool from Products.Zuul.facades import TreeFacade diff --git a/Products/Zuul/facades/processfacade.py b/Products/Zuul/facades/processfacade.py index d488ca5cd3..c9c8d2b104 100644 --- a/Products/Zuul/facades/processfacade.py +++ b/Products/Zuul/facades/processfacade.py @@ -158,7 +158,7 @@ def getProcessList(self, deviceGuid): s = '' try: import subprocess - from Products.ZenUtils.Utils import binPath + from Products.ZenUtils.path import binPath device = IGUIDManager(self._dmd).getObject(deviceGuid) s = '# ' + device.id zenmodelerOpts = ['run', '--now', '--debug', '-v10', '-d', device.id] diff --git a/Products/Zuul/routers/nav.py b/Products/Zuul/routers/nav.py index 37b19c4f76..eb939a77a4 100644 --- a/Products/Zuul/routers/nav.py +++ b/Products/Zuul/routers/nav.py @@ -18,7 +18,7 @@ from Products.ZenUtils.Ext import DirectRouter from Products.ZenUtils.extdirect.router import DirectResponse from Products.ZenUI3.security.security import permissionsForContext -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath # page stats logger log = logging.getLogger('zen.pagestats') # create file handler which logs even debug messages diff --git a/bin/addSystemUser.py b/bin/addSystemUser.py index 9b53eb36f0..7d36f66e85 100644 --- a/bin/addSystemUser.py +++ b/bin/addSystemUser.py @@ -12,7 +12,7 @@ import re import logging from ZODB.transact import transact -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from subprocess import call log = logging.getLogger("zenoss.addsystemuser") diff --git a/bin/zenbincheck b/bin/zenbincheck index 82110d5b61..3681103641 100755 --- a/bin/zenbincheck +++ b/bin/zenbincheck @@ -10,4 +10,4 @@ . $ZENHOME/bin/zenfunctions -$PYTHON -c "import sys; from Products.ZenUtils.Utils import binPath; sys.exit(0 if binPath(\"$CMD\") else 1)" +$PYTHON -c "import sys; from Products.ZenUtils.path import binPath; sys.exit(0 if binPath(\"$CMD\") else 1)" diff --git a/bin/zendoc_base b/bin/zendoc_base index 69841acd06..49c421c496 100755 --- a/bin/zendoc_base +++ b/bin/zendoc_base @@ -12,7 +12,8 @@ import os.path import datetime from Products.ZenUtils.ZenScriptBase import ZenScriptBase -from Products.ZenUtils.Utils import importClass, zenPath +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import importClass from transaction import commit class XMLContainer: diff --git a/bin/zendoc_zenpack b/bin/zendoc_zenpack index b86f14ae28..55a9712649 100755 --- a/bin/zendoc_zenpack +++ b/bin/zendoc_zenpack @@ -8,21 +8,26 @@ Create an XML file showing the items in the ZenPack. import os import os.path import datetime -import zope.component + from optparse import OptionParser +import zope.component + from Products.ZCatalog.ZCatalog import ZCatalog -from Products.ZenUtils.ZenScriptBase import ZenScriptBase -from Products.ZenUtils.Utils import importClass, zenPath -from Products.ZenRelations.RelationshipBase import RelationshipBase -from Products.ZenModel.interfaces import IZenDocProvider +from transaction import commit + from Products.ZenModel.DataPointGraphPoint import DataPointGraphPoint -from Products.ZenModel.RRDDataSource import RRDDataSource +from Products.ZenModel.GraphDefinition import GraphDefinition +from Products.ZenModel.interfaces import IZenDocProvider from Products.ZenModel.RRDDataPoint import RRDDataPoint -from Products.ZenModel.RRDTemplate import RRDTemplate +from Products.ZenModel.RRDDataSource import RRDDataSource from Products.ZenModel.RRDGraph import RRDGraph -from Products.ZenModel.GraphDefinition import GraphDefinition -from transaction import commit +from Products.ZenModel.RRDTemplate import RRDTemplate +from Products.ZenRelations.RelationshipBase import RelationshipBase +from Products.ZenUtils.path import zenPath +from Products.ZenUtils.Utils import importClass +from Products.ZenUtils.ZenScriptBase import ZenScriptBase + class XMLContainer: id = '' diff --git a/bin/zenossdbpack b/bin/zenossdbpack index cce457fac1..c5cce8c15b 100755 --- a/bin/zenossdbpack +++ b/bin/zenossdbpack @@ -16,7 +16,7 @@ import tempfile import argparse import subprocess -from Products.ZenUtils.Utils import zenPath +from Products.ZenUtils.path import zenPath from Products.ZenUtils.GlobalConfig import getGlobalConfiguration from relstorage import zodbpack diff --git a/bin/zenrun.d/zenpack-manager.sh b/bin/zenrun.d/zenpack-manager.sh index b0340bf9f9..3621ec4c5e 100644 --- a/bin/zenrun.d/zenpack-manager.sh +++ b/bin/zenrun.d/zenpack-manager.sh @@ -53,7 +53,7 @@ restore() { } link() { - VARPATH_SOURCE=$(unset TERM; echo "from Products.ZenUtils.Utils import varPath;print varPath('ZenPackSource')" | zendmd --script /dev/stdin) + VARPATH_SOURCE=$(unset TERM; echo "from Products.ZenUtils.path import varPath;print varPath('ZenPackSource')" | zendmd --script /dev/stdin) if ! [[ -d $VARPATH_SOURCE ]]; then echo "Unable to determine install path for linked zenpack, or path does not exist" echo "$VARPATH_SOURCE"