Project

General

Profile

Actions

Bug #4333

closed

Suspicious code for closing expected reports when target change

Added by François ARMAND almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Priority:
N/A
Category:
Web - Compliance & node report
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

I falled on that line of code:

https://github.com/Normation/rudder/blob/master/rudder-core/src/main/scala/com/normation/rudder/services/reports/ReportingServiceImpl.scala#L105

....
        case Some(serial) if ((serial == newSerial)&&(configs.size > 0)) =>
            // no change if same serial and some config appliable
            logger.debug("Same serial %s for ruleId %s, and configs presents".format(serial, ruleId))
            currentConfigurationsToRemove.remove(ruleId)

        case Some(serial) if ((serial == newSerial)&&(configs.size == 0)) => // same serial, but no targets
            // if there is not target, then it need to be closed
          logger.debug("Same serial, and no configs present")

        case Some(serial) => // not the same serial
          logger.debug("Not same serial")
            confToCreate += conf
            confToClose += ruleId

            currentConfigurationsToRemove.remove(ruleId)
      }

The second pasted case is strange, because the comment seems to say "No config present, I need to do something!" and then, nothing is done. Is that what is expected ?

Actions #1

Updated by Nicolas CHARLES almost 11 years ago

  • Status changed from New to Pending technical review

Yes, it is expected !
Be default, all configurations are to be removed ( https://github.com/Normation/rudder/blob/master/rudder-core/src/main/scala/com/normation/rudder/services/reports/ReportingServiceImpl.scala#L85 ), and they "saved" only if they should not be closed
So if there is no target, they need to be closed, so nothing is to be done :)

Actions #2

Updated by Nicolas CHARLES almost 11 years ago

  • Status changed from Pending technical review to Rejected
Actions

Also available in: Atom PDF