Skip to content

Commit 69a04d5

Browse files
author
Joanna Kotuła
committed
improve #425 simplified mock server
removed pidfile as not necessary anymore
1 parent fc1840e commit 69a04d5

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
@@ -21,7 +21,7 @@ platforms:
2121
networks:
2222
- name: testnet
2323
command: >
24-
bash -lc "pip install -r /srv/mock/requirements.txt && python /srv/mock/server.py /tmp/mock_ci.pid 8000"
24+
bash -lc "pip install -r /srv/mock/requirements.txt && python /srv/mock/server.py 8000"
2525
volumes:
2626
- "${MOLECULE_SCENARIO_DIRECTORY}/mock:/srv/mock:ro"
2727
published_ports:

0 commit comments

Comments
 (0)