Check if the user is root.
Before try to create the symlink check if the user is root. Change-Id: I869c3e6a3eadaf33bdab2745635e9db23dfc8cbb Partial-Bug: #1816446
This commit is contained in:
parent
828cfe02bb
commit
03df1ffe75
|
@ -107,16 +107,18 @@ class Deploy(command.Command):
|
||||||
python_cmd = "python{}".format(python_version)
|
python_cmd = "python{}".format(python_version)
|
||||||
|
|
||||||
# https://bugs.launchpad.net/tripleo/+bug/1812837
|
# https://bugs.launchpad.net/tripleo/+bug/1812837
|
||||||
if not os.path.exists('/usr/bin/ansible-playbook'):
|
if os.getuid() == 0:
|
||||||
if os.path.exists('/usr/bin/' + ansible_playbook_cmd):
|
if not os.path.exists('/usr/bin/ansible-playbook'):
|
||||||
if not os.path.exists('/usr/local/bin/ansible-playbook'):
|
if os.path.exists('/usr/bin/' + ansible_playbook_cmd):
|
||||||
os.symlink('/usr/bin/' + ansible_playbook_cmd,
|
if not os.path.exists('/usr/local/bin/ansible-playbook'):
|
||||||
'/usr/local/bin/ansible-playbook')
|
os.symlink('/usr/bin/' + ansible_playbook_cmd,
|
||||||
else:
|
'/usr/local/bin/ansible-playbook')
|
||||||
if not os.path.exists('/usr/bin/' + ansible_playbook_cmd):
|
else:
|
||||||
if not os.path.exists('/usr/local/bin/' + ansible_playbook_cmd):
|
if not os.path.exists('/usr/bin/' + ansible_playbook_cmd):
|
||||||
os.symlink('/usr/bin/ansible-playbook',
|
if not os.path.exists(
|
||||||
'/usr/local/bin/' + ansible_playbook_cmd)
|
'/usr/local/bin/' + ansible_playbook_cmd):
|
||||||
|
os.symlink('/usr/bin/ansible-playbook',
|
||||||
|
'/usr/local/bin/' + ansible_playbook_cmd)
|
||||||
|
|
||||||
def _is_undercloud_deploy(self, parsed_args):
|
def _is_undercloud_deploy(self, parsed_args):
|
||||||
return parsed_args.standalone_role == 'Undercloud' and \
|
return parsed_args.standalone_role == 'Undercloud' and \
|
||||||
|
|
Loading…
Reference in New Issue