Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR! Unexpected Exception, this is probably a bug: invalid syntax (command_runner_run_command.py, line 79) #19

Closed
a083138 opened this issue Oct 1, 2021 · 2 comments

Comments

@a083138
Copy link

a083138 commented Oct 1, 2021

I am trying to use this Ansible module for the first time and getting the above error. I get this no matter which of the sample playbooks I test at https://github.com/cisco-en-programmability/dnacenter-ansible/tree/main/playbooks. I am using the latest version of code.(3.1.6)

Below is the full error I see when I use this collection....

PLAY [Get Network Devices] *****************************************************
META: ran handlers
ERROR! Unexpected Exception, this is probably a bug: invalid syntax (command_runner_run_command.py, line 79)
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 123, in <module>
    exit_code = cli.run()
  File "/usr/lib/python2.7/site-packages/ansible/cli/playbook.py", line 127, in run
    results = pbex.run()
  File "/usr/lib/python2.7/site-packages/ansible/executor/playbook_executor.py", line 169, in run
    result = self._tqm.run(play=play)
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 241, in run
    play_return = strategy.run(iterator, play_context)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.py", line 248, in run
    action = action_loader.get(task.action, class_only=True)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 557, in get
    self._module_cache[path] = self._load_module_source(name, path)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 535, in _load_module_source
    module = imp.load_source(to_native(full_name), to_native(path), module_file)
  File "/var/lib/awx/.ansible/collections/ansible_collections/cisco/dnac/plugins/action/command_runner_run_command.py", line 79
    response = dnac.exec(
                       ^
SyntaxError: invalid syntax
@jbogarin
Copy link
Collaborator

jbogarin commented Oct 1, 2021

@a083138 Have you tried with Python 3? Python 2.x is not supported.

@a083138
Copy link
Author

a083138 commented Oct 5, 2021

@a083138 Have you tried with Python 3? Python 2.x is not supported.

I can confirm I used Python 3 and it did resolve the issue and the modules are now all working ok. Thanks for the advise!

@a083138 a083138 closed this as completed Oct 5, 2021
fmunozmiranda pushed a commit that referenced this issue Oct 13, 2023
fmunozmiranda pushed a commit that referenced this issue May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants