Just use python instead of perl, jeez.
This commit is contained in:
parent
9bfd64c4d1
commit
0077985855
@ -195,10 +195,17 @@ class HorizonInstaller(comp.PythonInstallComponent):
|
|||||||
fc = "WSGISocketPrefix %s" % (wsgi_socket_loc)
|
fc = "WSGISocketPrefix %s" % (wsgi_socket_loc)
|
||||||
sh.write_file(socket_conf, fc)
|
sh.write_file(socket_conf, fc)
|
||||||
#now adjust the run user and group
|
#now adjust the run user and group
|
||||||
cmd = ['perl', '-p', '-i', '-e', "'s/^User.*/User " + user + "/g'", '/etc/httpd/conf/httpd.conf']
|
fc = sh.load_file('/etc/httpd/conf/httpd.conf')
|
||||||
sh.execute(*cmd, run_as_root=True)
|
lines = fc.splitlines()
|
||||||
cmd = ['perl', '-p', '-i', '-e', "'s/^Group.*/Group " + group + "/g'", '/etc/httpd/conf/httpd.conf']
|
new_lines = list()
|
||||||
sh.execute(*cmd, run_as_root=True)
|
for line in lines:
|
||||||
|
if line.startswith("User "):
|
||||||
|
line = "User %s" % (user)
|
||||||
|
if line.startswith("Group "):
|
||||||
|
line = "Group %s" % (group)
|
||||||
|
new_lines.append(line)
|
||||||
|
contents = utils.joinlinesep(*new_lines)
|
||||||
|
sh.write_file('/etc/httpd/conf/httpd.conf', contents)
|
||||||
finally:
|
finally:
|
||||||
sh.user_mode()
|
sh.user_mode()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user