Quantcast
Channel: configuration - Forum - FlexGet
Viewing all articles
Browse latest Browse all 716

Config Validation, paths, and jinja

$
0
0

@jlyle wrote:

I have the following template defined in my config:

filter-transferring:
    crossmatch:
      from:
        - filesystem:
            path: "{{stage_path|default('/', True)}}"
            regexp: '^.*[\.-]transferring$'
            recursive: no
            retrieve:
              - files
      fields:
        - title
      action: reject
      exact: yes

Where I have defined "stage_path" via the set plugin in a couple other templates. When I try to check my config, i get the following:

check    Pre-checked 209 configuration lines
manager  [/templates/filter-transferring/crossmatch/from/0/filesystem/path] `` does not exist
manager  Failed to load config file: Did not pass schema validation.

Now, while I get that the stage_path entry field won't exist when running the check on the configuration, I figured adding the "default" jinja2 filter would solve the problem of the configuration thinking [/templates/filter-transferring/crossmatch/from/0/filesystem/path] is empty.

Any thoughts on this?

Please note:
I get the same results regardless of if the second parameter to the default filter is True or False.

Explanation of why I am doing this:
I am doing this because before I had multiple versions of the filter-transferring template defined, but it only differed by the path in the crossmatch/from/0/filesystem section. I realize there is no problem with having this defined multiple times as I did before, but it would be much cleaner and more elegant if I could get something like this to work.

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 716

Trending Articles