mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-06-19 23:05:58 +01:00
utils/misc: Update load structure to use WA's yaml wrapper
This commit is contained in:
@ -41,7 +41,6 @@ else:
|
|||||||
from itertools import chain, cycle
|
from itertools import chain, cycle
|
||||||
from distutils.spawn import find_executable # pylint: disable=no-name-in-module, import-error
|
from distutils.spawn import find_executable # pylint: disable=no-name-in-module, import-error
|
||||||
|
|
||||||
import yaml
|
|
||||||
from dateutil import tz
|
from dateutil import tz
|
||||||
|
|
||||||
# pylint: disable=wrong-import-order
|
# pylint: disable=wrong-import-order
|
||||||
@ -325,6 +324,11 @@ def load_struct_from_python(filepath=None, text=None):
|
|||||||
def load_struct_from_yaml(filepath=None, text=None):
|
def load_struct_from_yaml(filepath=None, text=None):
|
||||||
"""Parses a config structure from a .yaml file. The structure should be composed
|
"""Parses a config structure from a .yaml file. The structure should be composed
|
||||||
of basic Python types (strings, ints, lists, dicts, etc.)."""
|
of basic Python types (strings, ints, lists, dicts, etc.)."""
|
||||||
|
|
||||||
|
# Import here to avoid circular imports
|
||||||
|
# pylint: disable=wrong-import-position,cyclic-import
|
||||||
|
from wa.utils.serializer import yaml
|
||||||
|
|
||||||
if not (filepath or text) or (filepath and text):
|
if not (filepath or text) or (filepath and text):
|
||||||
raise ValueError('Exactly one of filepath or text must be specified.')
|
raise ValueError('Exactly one of filepath or text must be specified.')
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user