Skip to content

Conversation

@jlongever
Copy link
Contributor

  • Option to remove DHCP-Proxy dependency (example dhcpd.conf PR Add dhcpd.conf example to request profile without proxy. RackHD#114) and decouple DHCP service/least file tailing.
  • Creates lookup entry based on DHCP bootfile option request query parameters
  • Fixed unit-tests to use unique http/https ports that are causing random ADDRINUSE errors

@RackHD/corecommitters @geoff-reid @zyoung51 @uppalk1 @tannoa2 @anhou

- 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
router.get('/profiles', function (req, res) {
if (req.query.mac && req.query.ip) {
profileApiService.setNode(req.query);
req.query.macs = req.query.mac

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@keedya
Copy link

keedya commented Feb 29, 2016

👍

profileApiService.setNode(req.query);
req.query.macs = req.query.mac;
}

Copy link
Contributor

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.

@benbp
Copy link
Contributor

benbp commented Mar 1, 2016

👍 if you add a catch block/log.

*/

router.get('/profiles', function (req, res) {
if (req.query.mac && req.query.ip) {
Copy link
Member

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,

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

@jlongever jlongever force-pushed the api/enable_static_and_dynamic_ip_reg branch from bfe3fff to a4c6c8f Compare March 1, 2016 02:08
@anhou
Copy link
Member

anhou commented Mar 1, 2016

👍 after addressing the comments

@jlongever
Copy link
Contributor Author

@benbp

@jlongever
Copy link
Contributor Author

@anhou added query param description

@anhou
Copy link
Member

anhou commented Mar 1, 2016

@jlongever Thanks for refinement!

});

it("should send 500 set mac and ip fails", function() {
profileApiService.setLookup.rejects()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@jlongever jlongever force-pushed the api/enable_static_and_dynamic_ip_reg branch from 59311df to db3bf8a Compare March 1, 2016 02:42
anhou pushed a commit that referenced this pull request Mar 1, 2016
…ip_reg

Add dynamic and static IP/MAC lookups
@anhou anhou merged commit fd58cb3 into RackHD:master Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants