Refactor network.send_icmp to use deafult OS ping size#4
Open
MosheSheena wants to merge 3 commits intolukas-bednar:masterfrom
MosheSheena:refactor-send-icmp_master
Open
Refactor network.send_icmp to use deafult OS ping size#4MosheSheena wants to merge 3 commits intolukas-bednar:masterfrom MosheSheena:refactor-send-icmp_master
MosheSheena wants to merge 3 commits intolukas-bednar:masterfrom
MosheSheena:refactor-send-icmp_master
Conversation
This refactoring allows the function to use the default host OS ping size in case the 'size' parameter was not passed and does not rely on a default size of 1500
lukas-bednar
requested changes
Oct 24, 2018
Owner
lukas-bednar
left a comment
There was a problem hiding this comment.
Thanks, it looks good, I have two small comments there.
rrmngmnt/network.py
Outdated
| cmd.extend(["-M", "do"]) | ||
| cmd = ["ping", dst, "-c", count] | ||
| if size and size.isdigit(): | ||
| cmd.extend(["-s", "size", "-M", "do"]) |
Owner
There was a problem hiding this comment.
I believe that there should be size (without quotes)
Author
There was a problem hiding this comment.
Oh yes, it is there by mistake... Thanks for noticing :)
rrmngmnt/network.py
Outdated
| if size != "1500": | ||
| cmd.extend(["-M", "do"]) | ||
| cmd = ["ping", dst, "-c", count] | ||
| if size and size.isdigit(): |
Owner
There was a problem hiding this comment.
I would change that condition to size is not None, and use str(size) in following line. I don't like approach to ignore parameter when it has wrong form - it is always better to fail.
added 2 commits
October 24, 2018 15:28
This refactoring allows the function to use the default host OS ping size in case the 'size' parameter was not passed and does not rely on a default size of 1500
…thon-rrmngmnt into refactor-send-icmp_master
Author
|
Hi @lukas-bednar, I've performed the changes and committed them |
lukas-bednar
approved these changes
Oct 24, 2018
Author
|
Hi @lukas-bednar I just noticed this one's open... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This refactoring allows the function to use the default
host OS ping size in case the 'size' parameter was not passed
and does not rely on a default size of 1500