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 Feb 16, 2024
1 parent 0fef347 commit 9806b60
Show file tree
Hide file tree
Showing 135 changed files with 172 additions and 152 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 @@ -58,7 +58,8 @@
from Products.ZenEvents.ZenEventClasses import Heartbeat, Error
from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon, HubDown
from Products.ZenUtils.Driver import drive, driveLater
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/ZenCollector/configcache/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenCollector/configcache/app/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenCollector/configcache/app/pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
3 changes: 2 additions & 1 deletion Products/ZenCollector/configcache/app/zodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
6 changes: 1 addition & 5 deletions Products/ZenEvents/SyslogMsgFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
#
##############################################################################



__doc__ = """zensyslog
Filters Syslog Messages.
"""

import sys
import logging
import os.path
import re

import zope.interface
Expand All @@ -28,10 +24,10 @@
from Products.ZenHub.interfaces import ICollectorEventTransformer, \
TRANSFORM_CONTINUE, \
TRANSFORM_DROP
from Products.ZenUtils.Utils import unused, zenPath

log = logging.getLogger("zen.zensyslog.filter")


class SyslogMsgFilter(object):
implements(ICollectorEventTransformer)
"""
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 @@ -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


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 @@ -60,7 +60,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
7 changes: 2 additions & 5 deletions Products/ZenHub/zenhub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenHub/zenhubclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
from twisted.internet import defer, task
from twisted.spread import pb

from Products.ZenUtils.path import zenPath
from Products.ZenUtils.PBUtil import setKeepAlive
from Products.ZenUtils.Utils import zenPath, atomicWrite
from Products.ZenUtils.Utils import atomicWrite

from .errors import HubDown
from .server import ZenPBClientFactory
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
Loading

0 comments on commit 9806b60

Please sign in to comment.