-
Notifications
You must be signed in to change notification settings - Fork 3
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: netsim #66
refactor: netsim #66
Conversation
@flub tagged you in for a quick look around if you like, given you're our resident python expert and shown some interest in this bit. This part 1 of 3. |
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.
I've only given this a rather superficial review, not tried to understand the design and how things interact. Let me know if you'd like a more thorough review around the architecture - but that's a bunch more work :)
netsim/net/network.py
Outdated
"A Node with multicast stuff." | ||
class EdgeNode( Node ): | ||
def config( self, **params ): | ||
super( EdgeNode, self).config( **params ) |
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.
Do you still need this super syntax? I think this is python 2.7's super syntax. For 3.x you should use super().config(**params)
IIRC.
(also, what's with all the spacing around the bracket in this file? not very consistent)
netsim/net/network.py
Outdated
self.cmd( 'smcroutectl -I smcroute-' + self.name + | ||
' join ' + intfName + ' 239.0.0.1' ) | ||
|
||
def terminate( self ): |
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.
Consider making this class a context manager
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.
Also, I don't mean to hold anything up so consider this approved whenever you want to :)
Thank you. I mostly tagged you in to have someone else from the team be aware of it's existence (but I also knew you would give some input :) ) It's more/better than expected. A lot of the code base was cobbled together from different pieces and copy paste didn't do me a great service to keep things aligned. Starting with a formatter is a great 1st step. |
More or less a complete redo of netsim.