2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Do not let an existing /var/lib/confluent block the requisite chown

This commit is contained in:
Jarrod Johnson 2022-04-05 09:35:05 -04:00
parent 6fab77264c
commit 8ef91c16c0
2 changed files with 10 additions and 6 deletions

View File

@ -255,12 +255,8 @@ def initialize(cmdset):
sys.exit(1)
if cmdset.t or cmdset.s or cmdset.a or cmdset.u:
neededuid = os.stat('/etc/confluent').st_uid
try:
os.makedirs('/var/lib/confluent')
os.chown('/var/lib/confluent', neededuid, -1)
except OSError as e:
if e.errno != 17:
raise
util.mkdirp('/var/lib/confluent')
os.chown('/var/lib/confluent', neededuid, -1)
if cmdset.u:
didsomething = True
if not glob.glob('/root/.ssh/*.pub'):

View File

@ -29,6 +29,14 @@ import struct
import eventlet.green.subprocess as subprocess
def mkdirp(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != 17:
raise
def run(cmd):
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()