Merge "Initialize privsep root_helper command"

This commit is contained in:
Jenkins 2017-06-13 23:21:13 +00:00 committed by Gerrit Code Review
commit 309162a583
3 changed files with 8 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import hashlib
import logging
import math
import os
import shlex
import socket
import time
@ -38,10 +39,12 @@ try:
from cinderclient import exceptions as cinder_exception
from cinderclient.v2 import client as cinderclient
from os_brick.initiator import connector
from oslo_privsep import priv_context
except ImportError:
cinder_exception = None
cinderclient = None
connector = None
priv_context = None
CONF = cfg.CONF
@ -473,6 +476,7 @@ class Store(glance_store.driver.Store):
attach_mode = 'rw' if mode == 'wb' else 'ro'
device = None
root_helper = get_root_helper()
priv_context.init(root_helper=shlex.split(root_helper))
host = socket.gethostname()
properties = connector.get_connector_properties(root_helper, host,
False, False)

View File

@ -158,12 +158,14 @@ class TestCinderStore(base.StoreBaseTest,
kwargs['conn'])
return fake_connector
root_helper = "sudo glance-rootwrap /etc/glance/rootwrap.conf"
with mock.patch.object(cinder.Store,
'_wait_volume_status',
return_value=fake_volume), \
mock.patch.object(cinder, 'temporary_chown',
side_effect=fake_chown), \
mock.patch.object(cinder, 'get_root_helper'), \
mock.patch.object(cinder, 'get_root_helper',
return_value=root_helper), \
mock.patch.object(connector, 'get_connector_properties'), \
mock.patch.object(connector.InitiatorConnector, 'factory',
side_effect=fake_factory):

View File

@ -62,6 +62,7 @@ cinder =
python-cinderclient>=2.0.1 # Apache-2.0
os-brick>=1.11.0 # Apache-2.0
oslo.rootwrap>=5.0.0 # Apache-2.0
oslo.privsep>=1.9.0 # Apache-2.0
[build_sphinx]
source-dir = doc/source