-
Notifications
You must be signed in to change notification settings - Fork 32
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 ShellCommandHelper and add OvsHelper #934
Conversation
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
==========================================
- Coverage 82.70% 82.42% -0.28%
==========================================
Files 46 46
Lines 5862 5862
==========================================
- Hits 4848 4832 -16
- Misses 1014 1030 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
bin/build_daq_container
Outdated
@@ -12,6 +12,6 @@ bin/setup_remote forch | |||
|
|||
echo Starting $image_name build... | |||
|
|||
docker build . -f docker/modules/Dockerfile.daq --build-arg GIT_URL -t daqf/$image_name | |||
docker build . -f docker/modules/Dockerfile.daq -t daqf/$image_name |
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.
why remove this?
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 thought that arg wasn't getting consumed anywhere. Is that a mistake?
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 forget exactly how it works, but it sets an environment variable which is consumed somewhere down the chain of things. Docs seem to imply that it also requires an ENV setting in the Dockerfile, so not sure if it works without that or if it's broken.
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.
Fair enough. I reverted that particular bit. Thought I was cleaning up something. Better not to break things.
device_coupler/ovs_helper.py
Outdated
|
||
|
||
class OvsHelper: | ||
"""Class to build OVS, VxLANs and other network components""" |
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 don't think "build OVS" is what you mean here -- that implies actually compiling OVS (which is a thing). Do you mean something like construct an OVS bridge?
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 meant OVS network components but updated it.
device_coupler/ovs_helper.py
Outdated
def delete_ovs_bridge(self, name): | ||
"""Delete ovs bridge""" | ||
self._logger.info('Deleting OVS bridge %s', name) | ||
self._run_shell_no_raise('sudo ovs-vsctl add-br %s' % name) |
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.
shouldn't this be for del br
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.
Yup. Updated.
vlan_str = ",".join(str(vlan) for vlan in vlans) | ||
self._run_shell('sudo ovs-vsctl set port %s trunks=%s' % (interface, vlan_str)) | ||
|
||
def create_faux_device(self, index): |
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.
Are we going to refactor cmd/faux to python?
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.
Probably a good idea long term, but I am not working on it atm. I just need the faux as a testing tool and simply running it as a shell script works for me.
The PR adds a module that helps create the OVS n/w setup needed to query DAQ interface/simulate an access switch.