d30554bc90
This PR makes and adjustment for Python 3 scoping rules which differ from Python 2. In Python 3, the variable __ex__ goes out of scope at the exit of the __try-except__ block. This means that when __ex__ is referred to on the lines that follow, it would be an _undefined name_ causing a __NameError__ to be raised instead of the expected __ConnectionError__. flake8 testing of https://github.com/ansible/ansible on Python 3.6.3 The command "echo ; echo -n "flake8 testing of ${URL} on " ; python -V" exited with 0. 130.72s$ time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics ./lib/ansible/module_utils/api.py:114:21: F823 local variable 'retry_count' (defined in enclosing scope on line 107) referenced before assignment retry_count += 1 # pylint: disable=undefined-variable ^ ./lib/ansible/module_utils/six/__init__.py:54:20: F821 undefined name 'basestring' string_types = basestring, ^ ./lib/ansible/module_utils/six/__init__.py:55:27: F821 undefined name 'long' integer_types = (int, long) ^ ./lib/ansible/module_utils/six/__init__.py:57:17: F821 undefined name 'unicode' text_type = unicode ^ ./lib/ansible/module_utils/six/__init__.py:658:16: F821 undefined name 'unicode' return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") ^ ./lib/ansible/module_utils/six/__init__.py:754:37: F821 undefined name 'basestring' if not isinstance(data, basestring): ^ ./lib/ansible/module_utils/six/__init__.py:757:32: F821 undefined name 'file' if (isinstance(fp, file) and ^ ./lib/ansible/module_utils/six/__init__.py:758:38: F821 undefined name 'unicode' isinstance(data, unicode) and ^ ./lib/ansible/module_utils/six/__init__.py:768:32: F821 undefined name 'unicode' if isinstance(sep, unicode): ^ ./lib/ansible/module_utils/six/__init__.py:774:32: F821 undefined name 'unicode' if isinstance(end, unicode): ^ ./lib/ansible/module_utils/six/__init__.py:782:36: F821 undefined name 'unicode' if isinstance(arg, unicode): ^ ./lib/ansible/module_utils/six/__init__.py:786:23: F821 undefined name 'unicode' newline = unicode("\n") ^ ./lib/ansible/module_utils/six/__init__.py:787:21: F821 undefined name 'unicode' space = unicode(" ") ^ ./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e' setMsg(str(e)) ^ ./lib/ansible/modules/cloud/openstack/os_user.py:202:38: F821 undefined name 'shade' if description and StrictVersion(shade.__version__) < StrictVersion('1.13.0'): ^ ./lib/ansible/modules/cloud/openstack/os_volume.py:153:27: F821 undefined name 'shade' StrictVersion(shade.__version__) < StrictVersion('1.22')): ^ ./lib/ansible/modules/files/archive.py:391:92: F821 undefined name 'e' module.fail_json(dest=dest, msg='Error deleting some source files: ' + str(e), files=errors) ^ ./lib/ansible/modules/network/dellos9/dellos9_facts.py:379:24: F821 undefined name 'key' parsed[key] += '\n%s' % line ^ ./lib/ansible/modules/network/dellos9/dellos9_facts.py:399:24: F821 undefined name 'key' parsed[key] += '\n%s' % line ^ ./lib/ansible/modules/network/dellos9/dellos9_facts.py:403:24: F821 undefined name 'key' parsed[key] += '\n%s' % line ^ ./lib/ansible/modules/network/dellos9/dellos9_facts.py:418:24: F821 undefined name 'key' parsed[key] += '\n%s' % line ^ ./lib/ansible/modules/network/f5/bigip_device_httpd.py:461:40: F821 undefined name 'ex' if 'Connection aborted' in str(ex) and 'redirectHttpToHttps' in params: ^ ./lib/ansible/modules/network/f5/bigip_device_httpd.py:465:33: F821 undefined name 'ex' raise F5ModuleError(str(ex)) ^ ./lib/ansible/modules/network/ironware/ironware_facts.py:274:24: F821 undefined name 'key' parsed[key] += '\n%s' % line ^ ./lib/ansible/modules/network/ironware/ironware_facts.py:514:24: F821 undefined name 'key' parsed[key] += '\n%s' % line ^ 24 F821 undefined name 'basestring' 1 F823 local variable 'retry_count' (defined in enclosing scope on line 107) referenced before assignment 25 |
||
---|---|---|
.github | ||
bin | ||
contrib | ||
docs | ||
examples | ||
hacking | ||
lib/ansible | ||
licenses | ||
packaging | ||
test | ||
ticket_stubs | ||
.coveragerc | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
.yamllint | ||
ansible-core-sitemap.xml | ||
CHANGELOG.md | ||
CODING_GUIDELINES.md | ||
CONTRIBUTING.md | ||
COPYING | ||
docsite_requirements.txt | ||
Makefile | ||
MANIFEST.in | ||
MODULE_GUIDELINES.md | ||
README.md | ||
RELEASES.txt | ||
requirements.txt | ||
ROADMAP.rst | ||
setup.py | ||
shippable.yml | ||
tox.ini | ||
VERSION |
Ansible
Ansible is a radically simple IT automation system. It handles configuration-management, application deployment, cloud provisioning, ad-hoc task-execution, and multinode orchestration - including trivializing things like zero-downtime rolling updates with load balancers.
Read the documentation and more at https://ansible.com/
You can find installation instructions here for a variety of platforms. Most users should probably install a released version of Ansible from pip
, a package manager or our release repository. Officially supported builds of Ansible are also available. Some power users run directly from the development branch - while significant efforts are made to ensure that devel
is reasonably stable, you're more likely to encounter breaking changes when running Ansible this way.
Design Principles
- Have a dead simple setup process and a minimal learning curve
- Manage machines very quickly and in parallel
- Avoid custom-agents and additional open ports, be agentless by leveraging the existing SSH daemon
- Describe infrastructure in a language that is both machine and human friendly
- Focus on security and easy auditability/review/rewriting of content
- Manage new remote machines instantly, without bootstrapping any software
- Allow module development in any dynamic language, not just Python
- Be usable as non-root
- Be the easiest IT automation system to use, ever.
Get Involved
- Read Community Information for all kinds of ways to contribute to and interact with the project, including mailing list information and how to submit bug reports and code to Ansible.
- All code submissions are done through pull requests. Take care to make sure no merge commits are in the submission, and use
git rebase
vsgit merge
for this reason. If submitting a large code change (other than modules), it's probably a good idea to join ansible-devel and talk about what you would like to do or add first and to avoid duplicate efforts. This not only helps everyone know what's going on, it also helps save time and effort if we decide some changes are needed. - Users list: ansible-project
- Development list: ansible-devel
- Announcement list: ansible-announce - read only
- irc.freenode.net: #ansible
Branch Info
- Releases are named after Led Zeppelin songs. (Releases prior to 2.0 were named after Van Halen songs.)
- The devel branch corresponds to the release actively under development.
- Various release-X.Y branches exist for previous releases.
- We'd love to have your contributions, read Community Information for notes on how to get started.
Authors
Ansible was created by Michael DeHaan (michael.dehaan/gmail/com) and has contributions from over 1000 users (and growing). Thanks everyone!
Ansible is sponsored by Ansible, Inc
License
GNU General Public License v3.0
See COPYING to see the full text.