Skip to content
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

added a job/tasks to add switch Macs to lookups #219

Merged
merged 2 commits into from
May 26, 2016

Conversation

SisterMystery
Copy link
Contributor

@SisterMystery SisterMystery commented May 25, 2016

solves https://github.com/RackHD/RackHD/issues/236
@RackHD/corecommitters @johren
Added a job that gets the mac addresses (including management) and adds them to the lookups collection.

supports on RackHD/on-taskgraph#107

.then(function(snmpData) {
return _.map(snmpData.data, function(val, key) {
if (key.startsWith("IF-MIB::ifPhysAddress")) {
val = _.map(val.split(':'), function(chunk) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment on why this is necessary might save future developers from confusion :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, put some sample data here will help other developer to understand the code.

@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Coverage increased (+0.05%) to 88.226% when pulling 4bee23c on VulpesArtificem:snmp-lookups into af80703 on RackHD:master.

@benbp
Copy link
Contributor

benbp commented May 25, 2016

👍

var self = this;
return waterline.catalogs.findLatestCatalogOfSource(self.nodeId, 'snmp-1')
.then(function(snmpData) {
return _.map(snmpData.data, function(val, key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about if catalog 'snmp-1' doesn't exist?
snmpData.data will throw a reference error because snmpData is undefined, but this error is not clear enough for debugging.

@yyscamper
Copy link
Contributor

+1 after comment is fixed.

@benbp
Copy link
Contributor

benbp commented May 25, 2016

👍 after @yyscamper's comments as well.

@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Coverage increased (+0.06%) to 88.234% when pulling 8e61ce0 on VulpesArtificem:snmp-lookups into af80703 on RackHD:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants