-
Notifications
You must be signed in to change notification settings - Fork 77
apply update regardless of node being found #395
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
Conversation
|
@benbp @brianparry FYI - from slack conversation with Benno |
|
Looks like our tests are very specific to the 1.1 API set - req.swagger.query vs. req.query |
lib/services/profiles-api-service.js
Outdated
|
|
||
| ProfileApiService.prototype.setLookup = function(req) { | ||
| var query = req.query; | ||
| var query = req.swagger.query; |
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.
@heckj I think we want to check whether the swagger object is defined in the request so that the profiles service will work with both the 1.1 and 2.0 APIs. I think this will fix your test failure as well.
var query = req.swagger ? req.swagger.query : req.query;
|
this flies in the face of some specific usage that was embedded in test cases - that a node wouldn't update if it was found (https://github.com/RackHD/on-http/blob/master/spec/lib/services/profiles-api-service-spec.js#L115-L128). @jlongever set this up originally - what would we be screwing up if we changed this logic to allow updates regardless of a node being found? Originally came from #157 based on blame/history... |
|
|
@heckj In my plan, 'query.macs & query.ips' will replace 'query.mac & qeury.ip' , temporally, be compatible inmy submitted PR #411. no matter node discovered or not. lookup ip and mac will be updated. on-dhcp-proxy also do like this https://github.com/RackHD/on-dhcp-proxy/blob/master/lib/message-handler.js#L61. @jlongever Anyway, 👍 for me |
|
test this please |
|
|
I'm updating the unit tests to match the code change - another commit pending... |
WIP
from @jeamland - debugging thread related to
/lookupsAPI not accepting an update