cinderlib.get_connector_properties raises an exception

Bug #1822976 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cinderlib
Fix Released
Undecided
Gorka Eguileor

Bug Description

[Bug reported by Ray Tan <tanshaolong> in old cinderlib repository https://github.com/Akrog/cinderlib/issues/18]

We get an exception when calling "get_connector_properties" in steps indicated the connection documentation for cases where we are sharing the metadata storage:
https://docs.openstack.org/cinderlib/latest/topics/connections.html#with-access-to-the-metadata-persistence-storage

Exception raised is:

>>> connector_dict = cl.get_connector_properties('sudo', '10.10.2.99', True, False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/os_brick/utils.py", line 137, in trace_logging_wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/os_brick/initiator/connector.py", line 256, in get_connector_properties
    enforce_multipath=enforce_multipath,
  File "/usr/lib/python2.7/site-packages/os_brick/initiator/connectors/base.py", line 56, in get_connector_properties
    execute=kwargs.get('execute')))
  File "/usr/lib/python2.7/site-packages/os_brick/initiator/linuxscsi.py", line 161, in is_multipath_running
    run_as_root=True, root_helper=root_helper)
  File "/usr/lib/python2.7/site-packages/os_brick/privileged/rootwrap.py", line 169, in execute
    return execute_root(*cmd, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_privsep/priv_context.py", line 204, in _wrap
    self.start()
  File "/usr/lib/python2.7/site-packages/oslo_privsep/priv_context.py", line 215, in start
    channel = daemon.RootwrapClientChannel(context=self)
  File "/usr/lib/python2.7/site-packages/oslo_privsep/daemon.py", line 327, in __init__
    raise FailedToDropPrivileges(msg)
oslo_privsep.daemon.FailedToDropPrivileges: privsep helper command exited non-zero (1)

Tags: privsep
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinderlib (master)

Fix proposed to branch: master
Review: https://review.openstack.org/649552

Changed in cinderlib:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinderlib (master)

Reviewed: https://review.openstack.org/649552
Committed: https://git.openstack.org/cgit/openstack/cinderlib/commit/?id=502f4ce9f47806a21c132cdb9cea7960f0c021c5
Submitter: Zuul
Branch: master

commit 502f4ce9f47806a21c132cdb9cea7960f0c021c5
Author: Gorka Eguileor <email address hidden>
Date: Wed Apr 3 11:53:18 2019 +0200

    Fix get_connector_properties

    We get exception oslo_privsep.daemon.FailedToDropPrivileges when calling
    cinderlib.get_connector_properties.

    This is because we make it point to OS-Brick's original method, which we
    later replace when we do the init in nos-brick. So cinderlib always
    call the replaced method, while cinderlib users will be calling the
    original OS-Brick method that hasn't replaced the privsep code.

    This patch fixes this by assigning our get_connector_properties method
    to the cinderlib method during the nos-brick initialization.

    We also have a tiny doc change where we were saying connection instead
    of connector, and some cosmetic changes in nos_brick to improve
    readability, since we were using acronyms bgcp and bcp, which we now
    replace for some more meaningful names.

    Closes-Bug: #1822976
    Change-Id: I627289418d52bdab826d1cf1a941e5671aaf2239

Changed in cinderlib:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.