Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure correct ordering of concat::fragments #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kBite
Copy link
Contributor

@kBite kBite commented Jan 31, 2024

Fragments that share the same order number are ordered by name.

"${chain}-${interface}-aaa"
"${chain}-${interface}-${name}"
"${chain}-${interface}-zzz"

If name starts with upper case letter they're placed outside of interface eth0 {}:

  mod comment comment 'AAA-minimal_example' proto all ACCEPT;
interface eth0 {
  mod comment comment 'aaa-minimal_example:' proto all ACCEPT;
  mod comment comment 'minimal_example' proto all ACCEPT;
}

I looked into testing for correct ordering, but didn't find a working solution.

There is (e.g.) .that_comes_before, but that's testing against before => ....

I also unsuccessfully tried testing against the content of File[/etc/ferm.d/chains/INPUT.conf] generated by concat_file.

> Fragments that share the same order number are ordered by name.
```
"${chain}-${interface}-aaa"
"${chain}-${interface}-${name}"
"${chain}-${interface}-zzz"
```

If `name` starts with upper case letter they're placed outside of
`interface eth0 {}`:

```
  mod comment comment 'AAA-minimal_example' proto all ACCEPT;
interface eth0 {
  mod comment comment 'aaa-minimal_example:' proto all ACCEPT;
  mod comment comment 'minimal_example' proto all ACCEPT;
}
```
@kBite kBite self-assigned this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants