Skip to content

juniper.device.command truncates the command output if it contains ## #827

@rahul-sundaresan

Description

@rahul-sundaresan

Version 2.0.1
If a command output contains ##, the module will stop processing at that point and won't return anything after.
For eg:
On a device CLI, running show configuration | no-more prints the following

<previous stanza omitted for clarity>
forwarding-options {
            filter {
                input pm_wireshark1_L2;
                ##
                ## Warning: statement ignored: unsupported platform (mx960)
                ##
                output pm_wireshark1_L2;
            }
        }
<more to come, but I've omitted it>

I'm retrieving the config using

  - name: "Get committed configuration in conf format"
    juniper.device.command:
      commands:
        - "show configuration"
      timeout: 350
    register: show_conf

show_conf.stdout will contain all the config up until the ##. Anything after the warning stanza isn't present in show_conf.stdout

PS: The reason I'm not using juniper.device.config to retrieve the config is because it performs a config lock even if I'm reading the committed config

Metadata

Metadata

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions