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

make build_ansible.command_plugins a real python module #61214

Closed
wants to merge 1 commit into from

Conversation

@evgeni
Copy link
Contributor

commented Aug 23, 2019

SUMMARY

this allows Python2 to properly find the plugins

before:

% python .tmp/ansible/hacking/build-ansible.py -h
Traceback (most recent call last):
  File ".tmp/ansible/hacking/build-ansible.py", line 88, in <module>
    main()
  File ".tmp/ansible/hacking/build-ansible.py", line 59, in main
    subcommands.pipe('init_parser', subparsers.add_parser)
  File "/usr/lib/python2.7/site-packages/straight/plugin/manager.py", line 61, in pipe
    return r
UnboundLocalError: local variable 'r' referenced before assignment

after:

% python .tmp/ansible/hacking/build-ansible.py -h
usage: build-ansible.py [-h] {document-plugins,porting-guide} ...

Implements utilities to build Ansible

optional arguments:
  -h, --help            show this help message and exit

Subcommands:
  {document-plugins,porting-guide}
                        for help use build-ansible.py SUBCOMMANDS -h
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

hacking/build_library/build_ansible/command_plugins/

ADDITIONAL INFORMATION

make build_ansible.command_plugins a real python module
this allows Python2 to properly find the plugins

before:
```
% python .tmp/ansible/hacking/build-ansible.py -h
Traceback (most recent call last):
  File ".tmp/ansible/hacking/build-ansible.py", line 88, in <module>
    main()
  File ".tmp/ansible/hacking/build-ansible.py", line 59, in main
    subcommands.pipe('init_parser', subparsers.add_parser)
  File "/usr/lib/python2.7/site-packages/straight/plugin/manager.py", line 61, in pipe
    return r
UnboundLocalError: local variable 'r' referenced before assignment
```

after:
```
% python .tmp/ansible/hacking/build-ansible.py -h
usage: build-ansible.py [-h] {document-plugins,porting-guide} ...

Implements utilities to build Ansible

optional arguments:
  -h, --help            show this help message and exit

Subcommands:
  {document-plugins,porting-guide}
                        for help use build-ansible.py SUBCOMMANDS -h
```
@abadger

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

command_plugins is a python3 namespace module. So we won't add an __init__.py there. The build scripts do require python 3 in order to run.

@abadger abadger closed this Aug 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.