Skip to content

Commit

Permalink
Refactor zenPath, binPath, varPath imports to import from ZenUtils.path
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeacock-zenoss committed Jun 21, 2023
1 parent 98d37c1 commit 9d116ee
Show file tree
Hide file tree
Showing 125 changed files with 149 additions and 130 deletions.
3 changes: 2 additions & 1 deletion Products/DataCollector/Plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
3 changes: 2 additions & 1 deletion Products/DataCollector/zenmodeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
from Products.ZenUtils.DaemonStats import DaemonStats
from Products.ZenUtils.Driver import drive, driveLater
from Products.ZenUtils.metricwriter import ThresholdNotifier
from Products.ZenUtils.Utils import unused, zenPath
from Products.ZenUtils.path import zenPath
from Products.ZenUtils.Utils import unused
from Products.Zuul.utils import safe_hasattr as hasattr

# needed for Twisted's PB (Perspective Broker) to work
Expand Down
2 changes: 1 addition & 1 deletion Products/Jobber/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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

__all__ = ("Celery", "ZenJobs")

Expand Down
2 changes: 1 addition & 1 deletion Products/Jobber/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ZenJobs
from .interfaces import IJobStore
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenCallHome/transport/crypt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion Products/ZenCallHome/transport/cycler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/EventClassInst.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/TrapFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from Products.ZenHub.interfaces import ICollectorEventTransformer, \
TRANSFORM_CONTINUE, \
TRANSFORM_DROP
from Products.ZenUtils.Utils import unused, zenPath
from Products.ZenUtils.path import zenPath

log = logging.getLogger("zen.zentrap")

Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/tests/sendSnmpPcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/zeneventd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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


Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/zeneventdWorkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/zeneventmigrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
from Products.ZenEvents.syslog_h import fac_values, LOG_FAC
from Products.ZenUtils.AmqpDataManager import AmqpTransaction
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
from Products.ZenUtils.Utils import zenPath
from Products.ZenUtils.path import zenPath
from Products.ZenUtils.guid.interfaces import IGlobalIdentifier
from zope.component import getUtility
from Products.ZenMessaging.queuemessaging.interfaces import IQueuePublisher
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/zensendsyslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/zensyslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

from Products.ZenEvents.SyslogProcessing import SyslogProcessor

from Products.ZenUtils.Utils import zenPath
from Products.ZenUtils.path import zenPath
from Products.ZenUtils.IpUtil import asyncNameLookup

from Products.ZenEvents.EventServer import Stats
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenEvents/zentestsyslogrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenHub/PBDaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
ThresholdNotifier,
)
from Products.ZenUtils.PBUtil import ReconnectingPBClientFactory
from Products.ZenUtils.Utils import zenPath, atomicWrite
from Products.ZenUtils.path import zenPath
from Products.ZenUtils.Utils import atomicWrite
from Products.ZenUtils.ZenDaemon import ZenDaemon

from .interfaces import (
Expand Down
7 changes: 2 additions & 5 deletions Products/ZenHub/zenhub.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,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 (
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenHub/zenhubworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
from Products.ZenUtils.debugtools import ContinuousProfiler
from Products.ZenUtils.PBUtil import setKeepAlive
from Products.ZenUtils.Time import isoDateTime
from Products.ZenUtils.Utils import zenPath, atomicWrite, load_config
from Products.ZenUtils.path import zenPath
from Products.ZenUtils.Utils import atomicWrite, load_config
from Products.ZenUtils.ZCmdBase import ZCmdBase

IDLE = "None/None"
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenMessaging/queuemessaging/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenModel/DataRoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Products/ZenModel/IpNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,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

Expand Down
3 changes: 2 additions & 1 deletion Products/ZenModel/MibOrganizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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 Organizer import Organizer
from MibModule import MibModule
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenModel/PerformanceConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/RRDDataSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
##############################################################################


from Products.ZenUtils.Utils import binPath
from Products.ZenUtils.path import binPath

__doc__="""RRDDataSource
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenModel/ZenModelBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion Products/ZenModel/ZenModelRM.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenModel/ZenPack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/ZenPackLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/ZenPackManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/ZenossInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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 (
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/Migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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

import sys
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addMariaDBLogFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addNginxLogFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addOpenTSDBLogbackConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addRabbitMQGlobalConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addRabbitMQLogFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addRedisLogFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addSolrService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenModel/migrate/addThebeLogFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading

0 comments on commit 9d116ee

Please sign in to comment.