Skip to content

Commit

Permalink
Fix tool 'semgrep' warning for security reason.
Browse files Browse the repository at this point in the history
Signed-off-by: Clark Lee <guizhao.lh@alibaba-inc.com>
  • Loading branch information
clarklee-guizhao committed Mar 1, 2023
1 parent 71a7e69 commit f40e481
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sonic-pit/pit-sysdiag/src/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def convert_unicode(input):


def run_command(cmd):
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
if err and proc.returncode != 0:
return proc.returncode, err
return 0, out.decode().rstrip('\n')


def restful_command(cmd):
url = "http://240.1.1.1:8080/api/hw/rawcmd"
url = "https://240.1.1.1:8080/api/hw/rawcmd"
data = json.dumps({
"Command" : cmd
})
Expand Down

0 comments on commit f40e481

Please sign in to comment.