Skip to content

Commit 7bc6613

Browse files
Joanna Kotułaguenhter
authored andcommitted
improve #425 simplified mock server
removed pidfile as not necessary anymore
1 parent 74e7955 commit 7bc6613

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

molecule/default/mock/server.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,8 @@ def verify_runner():
4949

5050

5151
if __name__ == '__main__':
52-
pid = str(os.getpid())
53-
pidfile = os.path.expanduser(sys.argv[1])
54-
55-
if os.path.isfile(pidfile):
56-
print("{} already exists, exiting".format(pidfile))
57-
sys.exit(1)
58-
5952
port = int(sys.argv[2])
6053

61-
with open(pidfile, 'w') as f:
62-
f.write(pid)
63-
6454
logging.basicConfig(level=logging.DEBUG)
6555

66-
try:
67-
app.run(port=port, host="0.0.0.0", debug=True)
68-
finally:
69-
os.unlink(pidfile)
56+
app.run(port=port, host="0.0.0.0", debug=True)

molecule/default/molecule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ platforms:
2020
networks:
2121
- name: testnet
2222
command: >
23-
bash -lc "pip install -r /srv/mock/requirements.txt && python /srv/mock/server.py /tmp/mock_ci.pid 8000"
23+
bash -lc "pip install -r /srv/mock/requirements.txt && python /srv/mock/server.py 8000"
2424
volumes:
2525
- "${MOLECULE_SCENARIO_DIRECTORY}/mock:/srv/mock:ro"
2626
published_ports:

0 commit comments

Comments
 (0)