Bug 1375537 - gf_event python fails with ImportError
Summary: gf_event python fails with ImportError
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: eventsapi
Version: 3.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Aravinda VK
QA Contact:
URL:
Whiteboard:
Depends On: 1374587
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-13 10:49 UTC by Aravinda VK
Modified: 2016-12-06 06:00 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.9.0
Clone Of: 1374587
Environment:
Last Closed: 2016-12-06 06:00:21 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Aravinda VK 2016-09-13 10:49:08 UTC
+++ This bug was initially created as a clone of Bug #1374587 +++

Description of problem:

Calling gf_event causes import error for python-requests library. 

ImportError: No module named requests

As a workaround, we can install python-requests but this library not required if we are not using Events feature.

Traceback (most recent call last):
  File "/usr/local/libexec/glusterfs/python/syncdaemon/syncdutils.py", line 313, in twrap
    tf(*aa)
  File "/usr/local/libexec/glusterfs/python/syncdaemon/monitor.py", line 403, in wmon
    slave_host, master)
  File "/usr/local/libexec/glusterfs/python/syncdaemon/monitor.py", line 384, in monitor
    brick_path=w[0]['dir'])
  File "/usr/local/libexec/glusterfs/python/syncdaemon/syncdutils.py", line 519, in gf_event
    from events.gf_event import gf_event as gfevent
  File "/usr/local/libexec/glusterfs/events/gf_event.py", line 19, in <module>
    from utils import logger, setup_logger, get_config
  File "/usr/local/libexec/glusterfs/events/utils.py", line 16, in <module>
    import requests
ImportError: No module named requests

--- Additional comment from Worker Ant on 2016-09-09 03:19:09 EDT ---

REVIEW: http://review.gluster.org/15439 (eventsapi: Add conditional import for requests library) posted (#1) for review on master by Aravinda VK (avishwan)

--- Additional comment from Worker Ant on 2016-09-09 08:59:54 EDT ---

COMMIT: http://review.gluster.org/15439 committed in master by Aravinda VK (avishwan) 
------
commit aa742fd88e08eeb807dba1cb98402e8813ec6797
Author: Aravinda VK <avishwan>
Date:   Fri Sep 9 12:40:38 2016 +0530

    eventsapi: Add conditional import for requests library
    
    requests lib is used only during publishing event. gf_event python
    imports utils.py, and indirectly imports requests lib even though
    it is not required while sending event to eventsd.
    
    Moved "import requests" inside the "plugin_webhook" function.
    
    BUG: 1374587
    Change-Id: Ie3c8088b43d4d7952d01352731999bf8519c73c4
    Signed-off-by: Aravinda VK <avishwan>
    Reviewed-on: http://review.gluster.org/15439
    Reviewed-by: Prashanth Pai <ppai>
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Kotresh HR <khiremat>
    CentOS-regression: Gluster Build System <jenkins.org>

Comment 1 Worker Ant 2016-09-13 10:50:23 UTC
REVIEW: http://review.gluster.org/15487 (eventsapi: Add conditional import for requests library) posted (#1) for review on release-3.9 by Aravinda VK (avishwan)

Comment 2 Worker Ant 2016-09-15 09:29:08 UTC
COMMIT: http://review.gluster.org/15487 committed in release-3.9 by Aravinda VK (avishwan) 
------
commit 8668906b112a4053feecfea2072f7eb0a73a043c
Author: Aravinda VK <avishwan>
Date:   Fri Sep 9 12:40:38 2016 +0530

    eventsapi: Add conditional import for requests library
    
    requests lib is used only during publishing event. gf_event python
    imports utils.py, and indirectly imports requests lib even though
    it is not required while sending event to eventsd.
    
    Moved "import requests" inside the "plugin_webhook" function.
    
    > Reviewed-on: http://review.gluster.org/15439
    > Reviewed-by: Prashanth Pai <ppai>
    > Smoke: Gluster Build System <jenkins.org>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > Reviewed-by: Kotresh HR <khiremat>
    > CentOS-regression: Gluster Build System <jenkins.org>
    
    BUG: 1375537
    Change-Id: Ie3c8088b43d4d7952d01352731999bf8519c73c4
    Signed-off-by: Aravinda VK <avishwan>
    (cherry picked from commit aa742fd88e08eeb807dba1cb98402e8813ec6797)
    Reviewed-on: http://review.gluster.org/15487
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Atin Mukherjee <amukherj>

Comment 3 Aravinda VK 2016-10-27 05:23:05 UTC
glusterfs-3.9.0rc2 is released[1] and packages are available for different distributions[2] to test.

[1] http://www.gluster.org/pipermail/maintainers/2016-October/001601.html
[2] http://www.gluster.org/pipermail/maintainers/2016-October/001605.html and http://www.gluster.org/pipermail/maintainers/2016-October/001606.html

Comment 4 Aravinda VK 2016-12-06 06:00:21 UTC
Gluster 3.9 GA is released http://blog.gluster.org/2016/11/announcing-gluster-3-9/


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