Skip to content

juniper.device 1.0.7 - ansible.module_utils.connection.ConnectionError: name 'rsp' is not defined #711

@slefol

Description

@slefol

Issue Type

  • Bug Report

Module Name

juniper.device 1.0.7

Summary

I get the following error when trying to run a command using juniper.device.config using juniper.device version 1.0.7.
(with format: "json")

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: name 'rsp' is not defined

Steps to reproduce

Ran a playbook with task below

  tasks:
        - name: "Retrieve the acls configuration"
          juniper.device.config:
            retrieve: "committed"
            filter: "<configuration><firewall><family><inet>
            <filter><name>toto-in</name></filter>
            <filter><name>toto-out</name></filter>
            </inet></family></firewall></configuration>"
            format: "json"
          register: response

To solve the issue, just replace "return rsp" by "return resp" on line 466 of the juniper/device/plugins/connection/pyez.py file

~/.ans/co/ansible_collections/juniper/device/plugins/connection/pyez.py (ligne 466)
462         resp = self.dev.rpc.get_config(
463             filter_xml, options, model, namespace, remove_ns, **kwarg
464         )
465         if options['format'] == 'json':
466             return resp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions