Page MenuHomePhabricator

Add a utility for querying values in config files
Closed, ResolvedPublicFEATURE REQUEST

Description

Some scripts that run early in the boot process need to read values from the config before it's loaded, so they have to operate on the config file directly. Right now it's usually done with grep, which only works with options that have unique names. An example can be found in https://github.com/vyos/vyatta-conntrack/blob/current/scripts/check-params-on-reboot.d/conntrack-hash-size

The only option to do that is to write a Python script and use vyos.configtree, which is not always desirable, and when it comes to custom scripts made by users, the users may be unfamiliar with Python or simply prefer another language.

A wrapper for vyos.configtree can simplify that. For example:

vyos-config-file-query --file /config/config.boot --path "system options whatever" <--return-value|--return-values|--list-nodes|--exists> [--json]

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

dmbaturin created this task.Jun 1 2019, 4:21 AM
dmbaturin closed this task as Resolved.Jun 1 2019, 4:26 AM
dmbaturin claimed this task.
syncer moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.2) board.
syncer moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.