Skip to content

Commit

Permalink
[fix][plugins/onprem] Fix log formating in forked onprem collector (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lloesche committed Feb 2, 2023
1 parent 5103347 commit bc5219f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions plugins/onprem/resoto_plugin_onprem/__init__.py
@@ -1,5 +1,4 @@
from resotolib.baseresources import BaseResource
import resotolib.logger
import socket
import multiprocessing
import resotolib.proc
Expand All @@ -13,8 +12,7 @@
from .config import OnpremConfig
from paramiko import ssh_exception
from typing import Dict

log = resotolib.logger.getLogger("resoto." + __name__)
from resotolib.logger import log, setup_logger


class OnpremCollectorPlugin(BaseCollectorPlugin):
Expand Down Expand Up @@ -104,6 +102,8 @@ def add_config(config: Config) -> None:
def collect_server(srv: Dict, args: Namespace = None, running_config: RunningConfig = None) -> Dict:
if args is not None:
ArgumentParser.args = args
setup_logger("resotoworker-onprem", force=True, level=getattr(args, "log_level", None))

if running_config is not None:
Config.running_config.apply(running_config)

Expand Down
4 changes: 1 addition & 3 deletions plugins/onprem/resoto_plugin_onprem/resources.py
@@ -1,4 +1,3 @@
import resotolib.logger
from attrs import define
from typing import Optional, ClassVar
from resotolib.graph import Graph
Expand All @@ -8,8 +7,7 @@
BaseInstance,
BaseNetwork,
)

log = resotolib.logger.getLogger("resoto." + __name__)
from resotolib.logger import log


@define(eq=False, slots=False)
Expand Down
4 changes: 1 addition & 3 deletions plugins/onprem/resoto_plugin_onprem/ssh.py
@@ -1,10 +1,8 @@
import resotolib.logger
from collections import defaultdict
from paramiko import SSHClient
from .resources import OnpremInstance
from resotolib.baseresources import InstanceStatus

log = resotolib.logger.getLogger("resoto." + __name__)
from resotolib.logger import log


instance_status_map = {
Expand Down

0 comments on commit bc5219f

Please sign in to comment.