1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-20 16:41:13 -05:00

reworked usage of importlib.metadata

For whatever reason passing in group in python 3.9.x
fails for importlib_metadata.entry_points.  This patch
fetches all and filters through them to get the real
oslo.config.opts entry points now.  This is to find all
of the config options of aprsd and the plugins
This commit is contained in:
Hemna 2023-01-02 14:12:31 -05:00
parent 29b8764124
commit a5520b2cd3

View File

@ -21,7 +21,7 @@
# python included libs
import datetime
from importlib.metadata import entry_points
import importlib.metadata as imp
from importlib.metadata import version as metadata_version
import logging
import os
@ -112,6 +112,8 @@ def check_version(ctx):
click.secho(msg, fg="green")
@cli.command()
@click.pass_context
def sample_config(ctx):
@ -120,7 +122,12 @@ def sample_config(ctx):
def get_namespaces():
args = []
selected = entry_points(group="oslo.config.opts")
all = imp.entry_points()
selected = []
if "oslo.config.opts" in all:
for x in all["oslo.config.opts"]:
if x.group == "oslo.config.opts":
selected.append(x)
for entry in selected:
if "aprsd" in entry.name:
args.append("--namespace")