Skip to content
Permalink
Browse files

werk: skip werks 9000 - 9999, which are reserved for CMA

Change-Id: Ia115af730e1d52ffab8315522bc832106cb2f32b
  • Loading branch information...
mo-ki committed Sep 2, 2019
1 parent a033468 commit 51cc2daa43ba55acf97e9084d2568d8532c3ea14
Showing with 7 additions and 1 deletion.
  1. +1 −1 tests/unit/cmk/utils/test_werks.py
  2. +6 −0 werk
@@ -28,7 +28,7 @@ def test_write_precompiled_werks(edition, tmp_path, monkeypatch):
cme_werks = dict([(w["id"], w) for w in all_werks.values() if w["edition"] == "cme"])

assert len(cre_werks) > 1000
assert [w for w in cre_werks.keys() if w >= 9000] == []
assert [w for w in cre_werks.keys() if 9000 <= w < 10000] == []
cmk.utils.werks.write_precompiled_werks(Path(tmp_dir) / "werks", cre_werks)

assert len(cee_werks) > 700
6 werk
@@ -802,6 +802,12 @@ def main_fetch_ids(args):
first_free = 7680
new_first_free = first_free + num

# cma werks are between 9000 and 9999. Skip over this area for new
# reserved werk ids
if 9000 <= first_free < 10000 or 9000 <= new_first_free < 10000:
first_free = 10000
new_first_free = first_free + num

# Store the werk_ids to reserve
my_ids = get_werk_ids() + range(first_free, new_first_free)
store_werk_ids(my_ids)

0 comments on commit 51cc2da

Please sign in to comment.
You can’t perform that action at this time.