diff --git a/buildgrid/_app/settings/parser.py b/buildgrid/_app/settings/parser.py index 6220d4e1661054a67b3f51b4ddaec937532b9b9c..403842ae6fdc73e2c769ffb182dceb8948beab2c 100644 --- a/buildgrid/_app/settings/parser.py +++ b/buildgrid/_app/settings/parser.py @@ -68,6 +68,15 @@ class Channel(YamlFactory): sys.exit(-1) +class Path(YamlFactory): + + yaml_tag = u'!path' + + def __new__(cls, path): + path = os.path.expanduser(path) + return path + + class Disk(YamlFactory): yaml_tag = u'!disk-storage' @@ -197,6 +206,7 @@ def _parse_size(size): def get_parser(): yaml.SafeLoader.add_constructor(Channel.yaml_tag, Channel.from_yaml) + yaml.SafeLoader.add_constructor(Path.yaml_tag, Path.from_yaml) yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml) yaml.SafeLoader.add_constructor(Action.yaml_tag, Action.from_yaml) yaml.SafeLoader.add_constructor(Reference.yaml_tag, Reference.from_yaml)