catch unsupported placeholder
This commit is contained in:
@@ -74,8 +74,13 @@ class StoragePartLock(StorageBase):
|
|||||||
else:
|
else:
|
||||||
# Process group is also used to identify child processes
|
# Process group is also used to identify child processes
|
||||||
preexec_fn = os.setpgrp
|
preexec_fn = os.setpgrp
|
||||||
command = self._hook % {
|
try:
|
||||||
"user": shlex.quote(user or "Anonymous")}
|
command = self._hook % {
|
||||||
|
"user": shlex.quote(user or "Anonymous")}
|
||||||
|
except KeyError as e:
|
||||||
|
logger.error("Storage hook contains not supported placeholder %s (skip execution of: %r)" % (e, self._hook))
|
||||||
|
return
|
||||||
|
|
||||||
logger.debug("Executing storage hook: '%s'" % command)
|
logger.debug("Executing storage hook: '%s'" % command)
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(
|
p = subprocess.Popen(
|
||||||
|
|||||||
Reference in New Issue
Block a user