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

Use socket.error instead of non-existent socket.Error #43499

Merged
merged 1 commit into from
Aug 1, 2018
Merged

Use socket.error instead of non-existent socket.Error #43499

merged 1 commit into from
Aug 1, 2018

Conversation

joren485
Copy link
Contributor

SUMMARY

Use socket.error of non-existent socket.Error.

P.S. No offense, but someone should look into refactoring lib/ansible/module_utils/network/cnos/cnos.py. It is 3.5k lines of hard to read code that contains many pep8 violations.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

cnos

ADDITIONAL INFORMATION
$ python2                                                                                 
Python 2.7.15 (default, Jun 27 2018, 13:05:28) 
[GCC 8.1.1 20180531] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.error
<class 'socket.error'>
>>> socket.Error
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Error'
>>>
$ python3                                                                                 
Python 3.6.6 (default, Jun 27 2018, 13:11:40) 
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.error
<class 'OSError'>
>>> socket.Error
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'socket' has no attribute 'Error'
>>>

@ansibot
Copy link
Contributor

ansibot commented Jul 31, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. networking Network category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Jul 31, 2018
@joren485 joren485 changed the title Use socket.error of non-existent socket.Error Use socket.error instead of non-existent socket.Error Jul 31, 2018
@ryansb ryansb removed the needs_triage Needs a first human triage before being processed. label Jul 31, 2018
@rcarrillocruz rcarrillocruz assigned Qalthos and unassigned Qalthos Aug 1, 2018
@Qalthos Qalthos merged commit 6d680d8 into ansible:devel Aug 1, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. networking Network category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants