Get rid of pkg_resources
... because pkg_resources was removed in Python 3.12 . Change-Id: Ib0de144da9d1933ea63aea585df4832c69d7c2fb
This commit is contained in:
parent
b9c987ee75
commit
6f8924a57c
@ -15,7 +15,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
|
||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import yaml
|
import yaml
|
||||||
@ -57,8 +56,9 @@ class ConfigManagerBase(object):
|
|||||||
if not cfg_loc:
|
if not cfg_loc:
|
||||||
LOG.debug("No pipeline definitions configuration file found! "
|
LOG.debug("No pipeline definitions configuration file found! "
|
||||||
"Using default config.")
|
"Using default config.")
|
||||||
cfg_loc = pkg_resources.resource_filename(
|
cfg_loc = os.path.join(
|
||||||
__name__, 'pipeline/data/' + cfg_file)
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
|
'pipeline', 'data', cfg_file)
|
||||||
with open(cfg_loc) as fap:
|
with open(cfg_loc) as fap:
|
||||||
conf = yaml.safe_load(fap)
|
conf = yaml.safe_load(fap)
|
||||||
LOG.debug("Config file: %s", conf)
|
LOG.debug("Config file: %s", conf)
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
import os
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import pkg_resources
|
|
||||||
|
|
||||||
from ceilometer import declarative
|
from ceilometer import declarative
|
||||||
from ceilometer.event import models
|
from ceilometer.event import models
|
||||||
@ -278,10 +278,12 @@ class NotificationEventsConverter(object):
|
|||||||
|
|
||||||
def setup_events(conf, trait_plugin_mgr):
|
def setup_events(conf, trait_plugin_mgr):
|
||||||
"""Setup the event definitions from yaml config file."""
|
"""Setup the event definitions from yaml config file."""
|
||||||
|
|
||||||
return NotificationEventsConverter(
|
return NotificationEventsConverter(
|
||||||
conf,
|
conf,
|
||||||
declarative.load_definitions(
|
declarative.load_definitions(
|
||||||
conf, [], conf.event.definitions_cfg_file,
|
conf, [], conf.event.definitions_cfg_file,
|
||||||
pkg_resources.resource_filename(
|
os.path.join(
|
||||||
'ceilometer', "pipeline/data/event_definitions.yaml")),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
|
'..', 'pipeline', 'data', 'event_definitions.yaml')),
|
||||||
trait_plugin_mgr)
|
trait_plugin_mgr)
|
||||||
|
@ -17,8 +17,7 @@ import fnmatch
|
|||||||
import itertools
|
import itertools
|
||||||
import json
|
import json
|
||||||
import operator
|
import operator
|
||||||
import pkg_resources
|
import os
|
||||||
import tenacity
|
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from gnocchiclient import exceptions as gnocchi_exc
|
from gnocchiclient import exceptions as gnocchi_exc
|
||||||
@ -26,6 +25,7 @@ from keystoneauth1 import exceptions as ka_exceptions
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
import tenacity
|
||||||
from urllib import parse as urlparse
|
from urllib import parse as urlparse
|
||||||
|
|
||||||
from ceilometer import cache_utils
|
from ceilometer import cache_utils
|
||||||
@ -243,8 +243,8 @@ class GnocchiPublisher(publisher.ConfigPublisherBase):
|
|||||||
namespace='ceilometer.event.trait_plugin')
|
namespace='ceilometer.event.trait_plugin')
|
||||||
data = declarative.load_definitions(
|
data = declarative.load_definitions(
|
||||||
conf, {}, resources_definition_file,
|
conf, {}, resources_definition_file,
|
||||||
pkg_resources.resource_filename(__name__,
|
os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||||
"data/gnocchi_resources.yaml"))
|
'data', 'gnocchi_resources.yaml'))
|
||||||
|
|
||||||
archive_policy_default = data.get("archive_policy_default",
|
archive_policy_default = data.get("archive_policy_default",
|
||||||
"ceilometer-low")
|
"ceilometer-low")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user