Skip to content

Commit 9465079

Browse files
fix(plan reading): use yaml safe_load (#1432)
Signed-off-by: Pant, Akshay <[email protected]>
1 parent bbe9a9f commit 9465079

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

openfl/experimental/workflow/interface/cli/aggregator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import yaml
1313
from click import Path as ClickPath
1414
from click import confirm, echo, group, option, pass_context, style
15-
from yaml.loader import SafeLoader
1615

1716
from openfl.cryptography.ca import sign_certificate
1817
from openfl.cryptography.io import get_csr_hash, read_crt, read_csr, read_key, write_crt, write_key
@@ -80,7 +79,7 @@ def start_(plan, authorized_cols, secure):
8079
)
8180
else:
8281
with open("plan/data.yaml", "r") as f:
83-
data = yaml.load(f, Loader=SafeLoader)
82+
data = yaml.safe_load(f)
8483
if data.get("aggregator", None) is None:
8584
logger.warning(
8685
"Aggregator private attributes are set to None as no aggregator"

openfl/experimental/workflow/interface/cli/collaborator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from click import Path as ClickPath
1919
from click import confirm, echo, group, option, pass_context, style
2020
from yaml import FullLoader, dump, load
21-
from yaml.loader import SafeLoader
2221

2322
from openfl.cryptography.ca import sign_certificate
2423
from openfl.cryptography.io import get_csr_hash, read_crt, read_csr, read_key, write_crt, write_key
@@ -83,7 +82,7 @@ def start_(plan, collaborator_name, secure, data_config="plan/data.yaml"):
8382
)
8483
else:
8584
with open(data_config, "r") as f:
86-
data = yaml.load(f, Loader=SafeLoader)
85+
data = yaml.safe_load(f)
8786
if data.get(collaborator_name, None) is None:
8887
logger.warning(
8988
f"Collaborator private attributes are set to None as no attributes"

0 commit comments

Comments
 (0)