mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 01:22:00 +00:00
Do not let an existing /var/lib/confluent block the requisite chown
This commit is contained in:
parent
6fab77264c
commit
8ef91c16c0
@ -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'):
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user