[Trivial Fix] Make profile directory if it doesn't exist
The current code assumes /tmp/profiles already exists. This creates it if it already doesn't to avoid OSError getting raised. Change-Id: Ib317f971e5345c5a40cfdad2a5956186a6dea252
This commit is contained in:
@@ -86,8 +86,12 @@ def deckhand_app_factory(global_config, **local_config):
|
|||||||
if CONF.profiler:
|
if CONF.profiler:
|
||||||
LOG.warning("Profiler ENABLED. Expect significant "
|
LOG.warning("Profiler ENABLED. Expect significant "
|
||||||
"performance overhead.")
|
"performance overhead.")
|
||||||
|
profile_dir = "/tmp/profiles" # nosec w/o profile data
|
||||||
|
if not os.path.isdir(profile_dir):
|
||||||
|
os.mkdir(profile_dir)
|
||||||
|
LOG.debug("Profiler artifacts will be saved to %s.", profile_dir)
|
||||||
return ProfilerMiddleware(
|
return ProfilerMiddleware(
|
||||||
configure_app(app, version='v1.0'),
|
configure_app(app, version='v1.0'),
|
||||||
profile_dir="/tmp/profiles") # nosec w/o profile data
|
profile_dir=profile_dir)
|
||||||
else:
|
else:
|
||||||
return configure_app(app, version='v1.0')
|
return configure_app(app, version='v1.0')
|
||||||
|
|||||||
Reference in New Issue
Block a user