Project

General

Profile

Bug #7908

mac address toggle between lower case and upper case in audit logs

Added by Ohad Levy over 4 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Network
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

I've seen in my audit logs the following:

Audit.where(:auditable_id => 194, :auditable_type => 'Host').limit(20).reorder("created_at DESC").map(&:audited_changes)
  Audited::Adapters::ActiveRecord::Audit Load (1.3ms)  SELECT `audits`.* FROM `audits` WHERE `audits`.`auditable_id` = 194 AND `audits`.`auditable_type` = 'Host' ORDER BY created_at DESC LIMIT 20
=> [{"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"], "ip"=>["10.35.27.6", "127.0.0.1"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}, {"mac"=>["E4:1F:13:CC:36:C0", "e4:1f:13:cc:36:c0"]}, {"mac"=>["e4:1f:13:cc:36:c0", "E4:1F:13:CC:36:C0"]}]

Related issues

Related to Foreman - Feature #7401: Add support for bond interfacesClosed2014-09-10
Related to Foreman - Bug #8456: undefined local variable or method `normalize_addresses' for #<Host::Discovered:0x000000102dbdc8>Closed2014-11-20

Associated revisions

Revision eaefbecc (diff)
Added by Marek Hulán over 4 years ago

Fixes #7908 - normalize mac before host get saved

For some reason we save host without running valdiations when we import
attributes from facts. Therefore we have to take care of mac
normalization by ourselves. We have to normalize it just after setting
new value because save can occure anytime.

Revision e9e0be61 (diff)
Added by Marek Hulán over 4 years ago

Fixes #7908 - normalize mac before host get saved

For some reason we save host without running valdiations when we import
attributes from facts. Therefore we have to take care of mac
normalization by ourselves. We have to normalize it just after setting
new value because save can occure anytime.

(cherry picked from commit eaefbecc2052dfea1805b4b7119ae124f823149c)

History

#1 Updated by Ohad Levy over 4 years ago

  • Related to Feature #7401: Add support for bond interfaces added

#2 Updated by Marek Hulán over 4 years ago

  • Status changed from New to Feedback
I'm unable to reproduce this from tests. I suspect the host save without validation that skips before_validation callbacks (which normalizes mac address), but whatever I do, I always get mac addresses downcased. Could you please:
  • upload several facter outputs from the host (to see which macaddresses changes the case and so I could write test based on this)
  • track audits per one host update
  • make sure it started to happen after bond PR was merged or find first such Audit record

#3 Updated by The Foreman Bot over 4 years ago

  • Status changed from Feedback to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1965 added
  • Pull request deleted ()

#4 Updated by Dominic Cleal over 4 years ago

  • Assignee set to Marek Hulán

#5 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 21

#6 Updated by Marek Hulán over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Dominic Cleal over 4 years ago

  • Related to Bug #8456: undefined local variable or method `normalize_addresses' for #<Host::Discovered:0x000000102dbdc8> added

Also available in: Atom PDF