file_ensure_key_value

Ensure that the file contains a pair of "key separator value".

⚙️ Compatible targets: Linux

⚠️ Deprecated: This method is deprecated and should not be used.

Parameters

NameDocumentation
pathFile name to edit (absolute path on the target node).

This parameter is required.
keyKey to define.

This parameter is required.
valueValue to define.

This parameter is required.
separatorSeparator between key and value, for example "=" or " " (without the quotes).

This parameter can contain only whitespaces.
This parameter is required.

Outcome conditions

You need to replace ${path} with its actual canonified value.

  • ✅ Ok: file_ensure_key_value_${path}_ok
    • ☑️ Already compliant: file_ensure_key_value_${path}_kept
    • 🟨 Repaired: file_ensure_key_value_${path}_repaired
  • ❌ Error: file_ensure_key_value_${path}_error

Example

method: file_ensure_key_value
params:
  key: VALUE
  value: VALUE
  separator: VALUE
  path: VALUE

Documentation

Edit (or create) the file, and ensure it contains an entry key -> value with arbitrary separator between the key and its value. If the key is already present, the method will change the value associated with this key.