Skip to content
Permalink
Browse files

werk: Take last werk ID into account while checking reserved ranges (…

…7500-7680, 8000-8780)

Change-Id: If680c5ec60a200a4c2e311ee499455a4048f64d0
  • Loading branch information...
si-23 committed May 20, 2019
1 parent f8ec3ed commit 15269aaf70ce5852d5b5dcb5338197753e25f53a
Showing with 15 additions and 13 deletions.
  1. +15 −13 werk
28 werk
@@ -785,23 +785,25 @@ def main_fetch_ids(args):

# Get the start werk_id to reserve
try:
first_free = int(eval(file('first_free').read()))

# enterprise werks were between 8000 and 8749. Skip over this area for new
# reserved werk ids
if first_free >= 8000 and first_free < 8780:
first_free = 8780

# cmk-omd werk were between 7500 and 7680. Skip over this area for new
# reserved werk ids
if first_free >= 7500 and first_free < 7680:
first_free = 7680
except:
first_free = int(file('first_free').read().strip())
except (IOError, ValueError):
first_free = 0

new_first_free = first_free + num
# enterprise werks were between 8000 and 8749. Skip over this area for new
# reserved werk ids
if 8000 <= first_free < 8780 or 8000 <= new_first_free < 8780:
first_free = 8780
new_first_free = first_free + num

# cmk-omd werk were between 7500 and 7680. Skip over this area for new
# reserved werk ids
if 7500 <= first_free < 7680 or 7500 <= new_first_free < 7680:
first_free = 7680
new_first_free = first_free + num

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

# Store the new reserved werk ids

0 comments on commit 15269aa

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