Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0.x/bug] Updating SubnetDivisionRule label breaks with underscores #547

Closed
pandafy opened this issue Sep 22, 2021 · 1 comment
Closed
Assignees
Labels

Comments

@pandafy
Copy link
Member

pandafy commented Sep 22, 2021

The code responseible for updating labels for existing variables is fragile and breaks if user enters a label with an underscore.

for index in index_queryset:
identifiers = index.keyword.split('_')
identifiers[0] = division_rule.label
index.keyword = '_'.join(identifiers)

How to replicate

  1. Create a subnet division rule with label OW_TEST
  2. Ensure that subnets and IPs are provisioned for this rule. (Required for storing variable names)
  3. Update the label to OW_TEST2

Actual Behavior

Subnet and IP variables are renamed as OW_TEST2_TEST_*

Expected Behavior

Subnet and IP variables should be renamed as OW_TEST2_*

@pandafy pandafy self-assigned this Sep 22, 2021
@pandafy pandafy added the bug label Sep 22, 2021
pandafy added a commit that referenced this issue Sep 23, 2021
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
nemesifier pushed a commit that referenced this issue Sep 26, 2021
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
@nemesifier
Copy link
Member

Closed by #548

pandafy added a commit that referenced this issue Oct 12, 2021
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
pandafy added a commit that referenced this issue Nov 26, 2021
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
pandafy added a commit that referenced this issue Nov 29, 2021
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
pandafy added a commit that referenced this issue Jan 12, 2022
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
pandafy added a commit that referenced this issue Jan 12, 2022
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
pandafy added a commit that referenced this issue Jan 19, 2022
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
codesankalp pushed a commit that referenced this issue Apr 21, 2022
Use iterator() instead of all() on queryset, since the number
of database row will be large for SubnetDivisionIndex.

Closes #547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants