Update cloud-web-ipallocator.py#9796
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
| cnt = len(dhcp_host.splitlines()) + 1 | ||
| script = f"""set {DNSMASQ_CONFIG}/dhcp-host[{cnt}] {mac},{newIP} | ||
| save""" | ||
| with open("/path/to/script", "w") as script_file: |
There was a problem hiding this comment.
what is the intention here?
| return None | ||
|
|
||
| script = f"rm {path}\n save" | ||
| with open("/path/to/script", "w") as script_file: |
There was a problem hiding this comment.
pretty sure "/path/to/script" is not intended.
Shebang updated for portability. Exception handling now prints error details. Used pop(0) for removing the first element from availIP. Added constants for better code management. Used f-strings for modern string formatting. File writing in with block for safety. Improved comments to enhance readability.
848df1d to
9057860
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9796 +/- ##
=========================================
Coverage 17.46% 17.46%
+ Complexity 15516 15514 -2
=========================================
Files 5913 5913
Lines 529385 529385
Branches 64679 64679
=========================================
Hits 92448 92448
Misses 426518 426518
Partials 10419 10419
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Shebang updated for portability.
Exception handling now prints error details.
Used pop(0) for removing the first element from availIP. Added constants for better code management.
Used f-strings for modern string formatting.
File writing in with block for safety.
Improved comments to enhance readability.
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?