forked from ohcnetwork/care
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load additional plugs on manager startup (ohcnetwork#2537)
* load additional plugs on manager startup * cleanup
- Loading branch information
Showing
2 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
import json | ||
import logging | ||
import os | ||
|
||
from plug_config import manager | ||
from plugs.plug import Plug | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
if ADDITIONAL_PLUGS := os.getenv("ADDITIONAL_PLUGS"): | ||
try: | ||
for plug in json.loads(ADDITIONAL_PLUGS): | ||
manager.add_plug(Plug(**plug)) | ||
except json.JSONDecodeError: | ||
logger.error("ADDITIONAL_PLUGS is not a valid JSON") | ||
|
||
manager.install() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters