-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update cloud-web-ipallocator.py #9796
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?