Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Jan 19, 2024
1 parent ac13a1a commit 796ca0e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions locust_swarm/swarm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
try:
import svs_locust
except ModuleNotFoundError:
# svs-locust is a library that is only used internally at Svenska Spel, please ignore it
# We need to import it here to get some variables and the path to the installed package
pass
import atexit
import logging
import os
Expand Down Expand Up @@ -245,21 +251,16 @@ def upload(server):
files = [args.locustfile or "locustfile.py"] + args.extra_files
if not args.skip_plugins:
try:
import locust_plugins

files.append(os.path.dirname(locust_plugins.__file__))
except ModuleNotFoundError:
logging.debug("locust-plugins wasnt installed")
files.append(os.path.dirname(svs_locust.__file__))
except NameError:
pass

try:
# svs-locust is a library that is only used internally at Svenska Spel, please ignore it

import svs_locust
import locust_plugins

files.append(os.path.dirname(svs_locust.__file__))
files.append(os.path.dirname(locust_plugins.__file__))
except ModuleNotFoundError:
pass

logging.debug("locust-plugins wasnt installed, not adding it to files to upload")
if len(files) > 1:
filestr = "{" + ",".join(files) + "}"
else:
Expand Down

0 comments on commit 796ca0e

Please sign in to comment.