Diff

The config diff feature provides the ability to compare the current running configuration of a device with a previously exported configuration template generated with ogcli export.

The config diff tool functions by performing an export of the current configuration of the system, and comparing it with a previous exported file, showing only the changes in a streamlined diff output containing the functional changes only.

Note:   The config diff tool performs the diff functionality in the same way as ogcli diff, and can be used interchangeably using export files in either format. See config diff in the Opengear CLI Guide.

Diff tool behavior

  • Diff shows additions, removals and changes clearly in the a streamlined format with only functional differences between the input and running configurations.

  • If any section, list item or sub-property is out of order between the input configuration and the running configuration, it is not shown in the diff unless the values have actually changed.

  • If the input configuration file is missing properties or sections of configuration, it shows the differences between running configuration and the default values for those properties.

  • If any property or configuration section is missing from input configuration, and the running configuration is identical to the system defaults, it is omitted from the diff output.

  • If diff function detects no differences between the current configuration and configuration template files match, a return code of 0 and no output is shown.

Syntax
diff <proposed_configuration_file>
Usage Examples

1. Active configuration matches input file:
No differences between input file and active configuration.

2. Configuration differs from template:
Differences displayed between input file and active configuration.

3. Configuration differs from template with defaults:
Differences between active configuration and default configuration because the input file was empty.

4. Configuration matches template with defaults:
No differences between active configuration and default configuration with empty input file.

Positional Arguments

<input_file> Diff active configuration against <input_file>.

Options
-h, --help Show this help message and exit.

If more detailed help is required, use config diff --help.

--secrets

The --secrets flag can be used to control how sensitive fields are displayed in the diff output. By default, sensitive fields are obfuscated.

If the proposed config file was exported with --secrets=cleartext or --secrets=mask then the same value must be used when running ogcli diff, for example, ogcli --secrets=cleartext diff <input file>

If the input file contains a different --secrets parameter than that provided, an error is returned.