Skip to content

Commit

Permalink
Merge pull request #284 from dmgav/add-username-to-tempdir
Browse files Browse the repository at this point in the history
Add username to temporary directory name (used in demo mode with IPython kernel)
  • Loading branch information
dmgav authored Jul 21, 2023
2 parents 61f2fb4 + 8763cdb commit a6d9b48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bluesky_queueserver/manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
import builtins
import copy
import getpass
import logging
import os
import sys
Expand Down Expand Up @@ -683,7 +684,7 @@ def _get_startup_options(self):
# If no location of startup code was specified, then load the default
# simulated ipython_sim/profile_collection_sim
if not any([startup_script, startup_module, startup_profile, ipython_dir]):
ipython_dir = os.path.join(tempfile.gettempdir(), "qserver", "ipython")
ipython_dir = os.path.join(tempfile.gettempdir(), f"qserver_{getpass.getuser()}", "ipython")
startup_profile = default_startup_profile
demo_mode = True

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import getpass
import os
import pprint
import re
Expand Down Expand Up @@ -451,12 +452,13 @@ def test_cli_parameters_zmq_server_address_1(monkeypatch, re_manager_cmd, test_m

def _get_expected_settings_default_1(tmpdir):
use_ip_kernel = use_ipykernel_for_tests()
username = getpass.getuser()
if use_ip_kernel:
startup_dir = None
ipython_dir = "/tmp/qserver/ipython"
ipython_dir = f"/tmp/qserver_{username}/ipython"
startup_profile = "collection_sim"
user_group_permissions_path = "/tmp/qserver/ipython/profile_collection_sim/startup"
existing_plans_and_devices_path = "/tmp/qserver/ipython/profile_collection_sim/startup"
user_group_permissions_path = f"/tmp/qserver_{username}/ipython/profile_collection_sim/startup"
existing_plans_and_devices_path = f"/tmp/qserver_{username}/ipython/profile_collection_sim/startup"
else:
startup_dir = "/bluesky_queueserver/profile_collection_sim/"
ipython_dir = None
Expand Down

0 comments on commit a6d9b48

Please sign in to comment.