Skip to content

Commit

Permalink
sqladvisor命令增加引号防止特殊字符导致运行报错,感谢Nick反馈
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo authored and 李环焕 committed Apr 15, 2018
1 parent 1d66ed7 commit 7e5cccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/views_ajax.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def sqladvisorcheck(request):
sqladvisor_path = getattr(settings, 'SQLADVISOR')
sqlContent = sqlContent.rstrip().replace('"', '\\"').replace('`', '\`').replace('\n', ' ')
try:
p = subprocess.Popen(sqladvisor_path + ' -h %s -P %s -u %s -p %s -d %s -v 1 -q "%s"' % (
p = subprocess.Popen(sqladvisor_path + ' -h %s -P %s -u %s -p \'%s\' -d %s -v 1 -q "%s"' % (
str(cluster_info.slave_host), str(cluster_info.slave_port), str(cluster_info.slave_user),
str(prpCryptor.decrypt(cluster_info.slave_password),), str(dbName), sqlContent), stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, universal_newlines=True)
Expand Down

0 comments on commit 7e5cccb

Please sign in to comment.