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

Refactor network.send_icmp to use deafult OS ping size #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Refactor network.send_icmp to use deafult OS ping size #4

wants to merge 3 commits into from

Conversation

MosheSheena
Copy link

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

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
Copy link
Owner

@lukas-bednar lukas-bednar left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good, I have two small comments there.

cmd.extend(["-M", "do"])
cmd = ["ping", dst, "-c", count]
if size and size.isdigit():
cmd.extend(["-s", "size", "-M", "do"])
Copy link
Owner

Choose a reason for hiding this comment

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

I believe that there should be size (without quotes)

Copy link
Author

Choose a reason for hiding this comment

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

Oh yes, it is there by mistake... Thanks for noticing :)

if size != "1500":
cmd.extend(["-M", "do"])
cmd = ["ping", dst, "-c", count]
if size and size.isdigit():
Copy link
Owner

@lukas-bednar lukas-bednar Oct 24, 2018

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

I agree with you

Moshe Sheena 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
@MosheSheena
Copy link
Author

Hi @lukas-bednar, I've performed the changes and committed them

@MosheSheena
Copy link
Author

Hi @lukas-bednar I just noticed this one's open...
What do we want to do here?

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

Successfully merging this pull request may close these issues.

2 participants