Add check on root dir so that we can ensure its useable ahead of time
This commit is contained in:
parent
eff471adea
commit
1793e79880
@ -200,6 +200,10 @@ def abspth(path):
|
||||
return os.path.abspath(path)
|
||||
|
||||
|
||||
def isuseable(path, options=os.W_OK|os.R_OK|os.X_OK):
|
||||
return os.access(path, options)
|
||||
|
||||
|
||||
def shellquote(text):
|
||||
# TODO since there doesn't seem to be a standard lib that actually works use this way...
|
||||
do_adjust = False
|
||||
|
3
stack
3
stack
@ -121,6 +121,9 @@ def run(args):
|
||||
root_dir = sh.joinpths(sh.gethomedir(), 'openstack')
|
||||
root_dir = sh.abspth(root_dir)
|
||||
setup_root(root_dir)
|
||||
if not sh.isuseable(root_dir):
|
||||
print(utils.color_text("Unreadable/writeable/executable root directory %r provided!" % (root_dir), "red"))
|
||||
return False
|
||||
|
||||
persona_fn = args.pop('persona_fn')
|
||||
if not persona_fn or not sh.isfile(persona_fn):
|
||||
|
Loading…
x
Reference in New Issue
Block a user