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

[fix] Always convert MAC address to uppercase format #922 #952

Merged
merged 4 commits into from
Dec 23, 2024

Conversation

dee077
Copy link
Contributor

@dee077 dee077 commented Dec 22, 2024

Automatically convert the MAC address to uppercase format in the model clean method to ensure consistency with the openwisp-config agent behavior.

Fixed lint error in ./openwisp_controller/geo/tests/test_api.py:97:52: E202 whitespace before '}'.

Fixes #922

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.

Reference to Existing Issue

Closes #922.

Description of Changes

  • Added functionality to automatically convert MAC address to uppercase format in the model clean method for consistency.
  • Fixed lint error in ./openwisp_controller/geo/tests/test_api.py:97:52: E202 whitespace before '}'.
  • Updated and added test cases to validate the changes.

Screenshot

Screenshot from 2024-12-22 21-51-01

  • A device named Test1 was added from the master branch with a lowercase MAC address.
  • A device named Test2 was added from the fix branch, as shown in the screenshot. Now, the MAC address is displayed in uppercase.

@pandafy pandafy force-pushed the issues/922-mac-address-uppercase branch from 8cb8f40 to 7adce69 Compare December 23, 2024 06:59
@coveralls
Copy link

coveralls commented Dec 23, 2024

Coverage Status

coverage: 98.261%. remained the same
when pulling 36783b8 on dee077:issues/922-mac-address-uppercase
into 07ae5ce on openwisp:master.

Resolved linting issue: E202 whitespace before '}' in ./openwisp_controller/geo/tests/test_api.py at line 97. Ensured code adheres to PEP 8 standards for better readability and consistency.
@dee077 dee077 force-pushed the issues/922-mac-address-uppercase branch from 7adce69 to 1b4d7bc Compare December 23, 2024 09:12
…penwisp#922

Automatically convert the MAC address to uppercase format in the model clean method to ensure consistency with the openwisp-config agent behavior.

Fixes openwisp#922
@dee077 dee077 force-pushed the issues/922-mac-address-uppercase branch from 1b4d7bc to 1309586 Compare December 23, 2024 09:22
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dee077 great progress, thanks for following up! 🙏

I'll apply a small change and verify the test fails without the fix, if good I will merge.

openwisp_controller/config/base/device.py Outdated Show resolved Hide resolved
@nemesifier nemesifier changed the title [bug] Convert MAC address to uppercase before device key generation #922 [fix] Convert MAC address to uppercase before device key generation #922 Dec 23, 2024
@nemesifier nemesifier changed the title [fix] Convert MAC address to uppercase before device key generation #922 [fix] Always convert MAC address to uppercase format #922 Dec 23, 2024
@nemesifier nemesifier merged commit 95ff8fe into openwisp:master Dec 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[bug] Mac address is case sensitive
4 participants