Enable some more bandit checks (#30857)

* Enable B108 (hardcoded tmp dir), address findings

* Enable B602 (subprocess popen with shell), address findings

* Enable B604 (start process with shell), address findings

* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
This commit is contained in:
Ville Skyttä authored and GitHub committed 2020-01-20 18:44:55 +02:00
1 parent 6cf20fc7fa
commit 5e2ba2eb77
21 files changed
+110 -91

No files matched your search

+2 -1
View File
@@ -10,6 +10,7 @@ import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.storage import STORAGE_DIR
_LOGGER = logging.getLogger(__name__)
@@ -54,7 +55,7 @@ CONFIG_SCHEMA = vol.Schema(
def setup(hass, config):
"""Create the ViCare component."""
conf = config[DOMAIN]
params = {"token_file": "/tmp/vicare_token.save"}
params = {"token_file": hass.config.path(STORAGE_DIR, "vicare_token.save")}
if conf.get(CONF_CIRCUIT) is not None:
params["circuit"] = conf[CONF_CIRCUIT]