Move the dac_admin privsep code to a new location.

Having utilities that are named after the context they use that no
longer exists is going to be super confusing later. Move these to
a better place.

Change-Id: Id203aa6c02c3b486f63151b3607e928990a6ca7b
blueprint: hurrah-for-privsep
This commit is contained in:
Michael Still
2017-09-18 23:14:11 +10:00
parent 5cae1d64bc
commit 8ea68a5ebe
12 changed files with 58 additions and 58 deletions

View File

@@ -653,12 +653,12 @@ def temporary_chown(path, owner_uid=None):
orig_uid = os.stat(path).st_uid
if orig_uid != owner_uid:
nova.privsep.dac_admin.chown(path, uid=owner_uid)
nova.privsep.path.chown(path, uid=owner_uid)
try:
yield
finally:
if orig_uid != owner_uid:
nova.privsep.dac_admin.chown(path, uid=orig_uid)
nova.privsep.path.chown(path, uid=orig_uid)
@contextlib.contextmanager