Skip to content

Commit

Permalink
Initialise oslo.privsep early in main
Browse files Browse the repository at this point in the history
Any process using oslo.privsep should now initialise the library before
first use with things like the rootwrap command to use.

This should be done near the top of main() in any command that expects
to make privileged calls via oslo.privsep (eg: nova-compute, and not
nova-api).

See I3ea73e16b07a870629e7d69e897f2524d7068ae8 for the corresponding
change in oslo.privsep.

Change-Id: I3a52f762deb176fe9201b2a0f0da363057f8aaec
Depends-On: I52259e2023e277e8fd62be5df4fd7f799e9b36d7
Closes-Bug: #1592043
  • Loading branch information
anguslees authored and sdague committed Aug 1, 2016
1 parent f9f46ee commit 4a8f2b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nova/cmd/compute.py
Expand Up @@ -16,10 +16,12 @@

"""Starter script for Nova Compute."""

import shlex
import sys
import traceback

from oslo_log import log as logging
from oslo_privsep import priv_context
from oslo_reports import guru_meditation_report as gmr

from nova.conductor import rpcapi as conductor_rpcapi
Expand Down Expand Up @@ -55,6 +57,7 @@ def __call__(self, *args, **kwargs):
def main():
config.parse_args(sys.argv)
logging.setup(CONF, 'nova')
priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
utils.monkey_patch()
objects.register_all()

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -46,6 +46,7 @@ oslo.db>=4.1.0 # Apache-2.0
oslo.rootwrap>=2.0.0 # Apache-2.0
oslo.messaging>=5.2.0 # Apache-2.0
oslo.policy>=1.9.0 # Apache-2.0
oslo.privsep>=1.9.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0
oslo.service>=1.10.0 # Apache-2.0
rfc3986>=0.2.0 # Apache-2.0
Expand Down

0 comments on commit 4a8f2b0

Please sign in to comment.