Skip to content

Support stdin for Configuration Input #8

Description

@jtdub

Problem

Configuration files must be provided as file paths. This prevents piping configurations from other tools or using here-docs.

Proposed Solution

Support "-" as a special filename to read from stdin:

napalm get_config | hier-config-cli remediation --platform ios --running-config - --generated-config intended.conf

Limitation: Only one of --running-config or --generated-config can be "-" since stdin can only be read once.

Acceptance Criteria

  • "-" reads from stdin for --running-config
  • "-" reads from stdin for --generated-config
  • Error if both are set to "-"
  • Works with pipes and here-docs
  • Documentation updated
  • Tests added

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions