-
Notifications
You must be signed in to change notification settings - Fork 77
Add dynamic and static IP/MAC lookups #157
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
Add dynamic and static IP/MAC lookups #157
Conversation
- Removes DHCP-Proxy dependency - Creates lookup based on DHCP bootfile option request query parameters - Fixed unit-tests to use unique http/https ports that was causing random ADDRINUSE errors
lib/api/1.1/southbound/profiles.js
Outdated
| router.get('/profiles', function (req, res) { | ||
| if (req.query.mac && req.query.ip) { | ||
| profileApiService.setNode(req.query); | ||
| req.query.macs = req.query.mac |
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.
Missing semicolon.
|
👍 |
lib/api/1.1/southbound/profiles.js
Outdated
| profileApiService.setNode(req.query); | ||
| req.query.macs = req.query.mac; | ||
| } | ||
|
|
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.
Should put a catch either here or in the service otherwise we'll lose any errors that occur with this call.
|
👍 if you add a catch block/log. |
Addres comments
| */ | ||
|
|
||
| router.get('/profiles', function (req, res) { | ||
| if (req.query.mac && req.query.ip) { |
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.
Could you help move the description like 'Creates lookup entry based on DHCP bootfile option request query parameters' to the annotations here? the message in PR wouldn't be included in codes, and annotations here will help a lot for knowing why having this codes, and also for code readablility,
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.
@anhou Are you looking for comments? There are other routes missing query parameter annotations; maybe there should be a story to track updating those as well.
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.
no, not for the routes, but for if() {... profileApiService.setLookup...} 's
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.
Right, there are a lot of route code that reference query parameters that offer no description.
bfe3fff to
a4c6c8f
Compare
|
👍 after addressing the comments |
|
@anhou added query param description |
|
@jlongever Thanks for refinement! |
spec/lib/api/1.1/profiles-spec.js
Outdated
| }); | ||
|
|
||
| it("should send 500 set mac and ip fails", function() { | ||
| profileApiService.setLookup.rejects() |
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.
Missing semicolon.
59311df to
db3bf8a
Compare
…ip_reg Add dynamic and static IP/MAC lookups
@RackHD/corecommitters @geoff-reid @zyoung51 @uppalk1 @tannoa2 @anhou