Bug 1384073 - ConnectionError exception is not imported correctly in fence_compute agent
Summary: ConnectionError exception is not imported correctly in fence_compute agent
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fence-agents
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-12 13:24 UTC by Marian Krcmarik
Modified: 2017-08-01 16:10 UTC (History)
3 users (show)

Fixed In Version: fence-agents-4.0.11-52.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 16:10:32 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1874 0 normal SHIPPED_LIVE fence-agents bug fix and enhancement update 2017-08-01 17:53:05 UTC

Description Marian Krcmarik 2016-10-12 13:24:44 UTC
Description of problem:
If a condition for raising the exception is met, I am getting traceback:
[ Traceback (most recent call last): ]
[   File "/usr/sbin/fence_compute", line 438, in <module> ]
[     main() ]
[   File "/usr/sbin/fence_compute", line 434, in main ]
[     result = fence_action(None, options, set_power_status, get_power_status, get_plugs_list,
 None) ]
   File "/usr/share/fence/fencing.py", line 973, in fence_action ]
[     status = get_multi_power_fn(tn, options, get_power_fn) ]
[   File "/usr/share/fence/fencing.py", line 880, in get_multi_power_fn ]
     plug_status = get_power_fn(tn, options) ]
[   File "/usr/sbin/fence_compute", line 48, in get_power_status ]
[     except ConnectionError as (err): ]
[ NameError: global name 'ConnectionError' is not defined ]

So either import should be edited as:
from requests.exceptions import ConnectionError or catching exception as
requests.exception.ConnectionError

Version-Release number of selected component (if applicable):
Always

How reproducible:
fence-agents-compute-4.0.11-47.el7.x86_64

Steps to Reproduce:
1. Set up a pck resource which uses fence-compute and use parameters for fence_compute that it's not possible to get conenction to nova API.

Actual results:
NameError: global name 'ConnectionError' is not defined

Expected results:
Logging an error.

Additional info:

Comment 2 Oyvind Albrigtsen 2016-10-17 11:06:25 UTC
https://github.com/ClusterLabs/fence-agents/pull/88

Comment 5 errata-xmlrpc 2017-08-01 16:10:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1874


Note You need to log in before you can comment on or make changes to this bug.