CCI-MOC / hil

Hardware Isolation Layer, formerly Hardware as a Service
Apache License 2.0
24 stars 54 forks source link

Call revert port with port_connect_nic #896

Closed naved001 closed 6 years ago

naved001 commented 7 years ago

If this seems reasonable I'll add some unit tests for this.

Again, should probably rebase this one once/if my other 2 PRs are merged (just to be safe).

naved001 commented 7 years ago

This comment by @zenhack

In short, if we wanted to deploy HIL in an environment without disturbing the pre-existing configuration; this patch would always remove the old config and start afresh.

But now that I think of it, if there's some pre-existing configuration then we would want HIL to have it in its database; so are we expecting HIL admins to manually edit the database? because I can't think of any other way of syncing a switchport status with HIL database. cc @zenhack

zenhack commented 7 years ago

Okay, yeah, I want to think more carefully about the details of retrofitting HIL onto an existing setup before we put some option to try to support it. Will mull it over.

naved001 commented 7 years ago

because I can't think of any other way of syncing a switchport status with HIL database

get_port_networks() gets half the info. We would still need to create networks in HIL (network label with a net id). And what if the networks on the switch fall outside the range of HIL allocation pool? do they become admin networks then?

naved001 commented 7 years ago

@SahilTikale @zenhack any thoughts?

zenhack commented 7 years ago

I'm tempted to suggest that we ignore that use case entirely for now, and deal with it separately. We're not really breaking anything, since you'd have to do some careful mucking with things (bordering on black magic) to get this to work as-is.

naved001 commented 7 years ago

@SahilTikale @zenhack got rid of the config file changes, and rebased this PR.

naved001 commented 7 years ago

I just gotta fix the plethora of failed tests, sigh.

naved001 commented 7 years ago

Fixing the unit tests requires some work. So everywhere we do port_connect_nic() we need to follow it with deferred.apply_networking(). Is there a smart way of doing this, or do I go about changing all files?

naved001 commented 7 years ago

Some of the tests fail locally for postgres but they don't stall like travis ci. :/c

naved001 commented 6 years ago

@SahilTikale @zenhack ping

naved001 commented 6 years ago

closing this, we'll implement something like this in the CLI then.