Added #nosec to sahara.utils.hacking package
The sahara.utils.hacking package is used for testing, as such the usages of subprocess within it should be marked as nosec according to the bandit documentation. Change-Id: If9299b050b9b158a78ab90b63afd94a5d4cbbf2c Closes-Bug: #1552468
This commit is contained in:
parent
67816de1f5
commit
d0c4351685
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess # nosec
|
||||||
|
|
||||||
from hacking import core
|
from hacking import core
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ class GitCheck(core.GlobalCheck):
|
|||||||
def _get_commit_title(self):
|
def _get_commit_title(self):
|
||||||
# Check if we're inside a git checkout
|
# Check if we're inside a git checkout
|
||||||
try:
|
try:
|
||||||
subp = subprocess.Popen(
|
subp = subprocess.Popen( # nosec
|
||||||
['git', 'rev-parse', '--show-toplevel'],
|
['git', 'rev-parse', '--show-toplevel'],
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
gitdir = subp.communicate()[0].rstrip()
|
gitdir = subp.communicate()[0].rstrip()
|
||||||
@ -35,7 +35,7 @@ class GitCheck(core.GlobalCheck):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
# Get title of most recent commit
|
# Get title of most recent commit
|
||||||
subp = subprocess.Popen(
|
subp = subprocess.Popen( # nosec
|
||||||
['git', 'log', '--no-merges', '--pretty=%s', '-1'],
|
['git', 'log', '--no-merges', '--pretty=%s', '-1'],
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
title = subp.communicate()[0]
|
title = subp.communicate()[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user