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

Fixes #17507: inventory watcher should ignore uuid.hive file #3007

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche VinceMacBuche requested a review from fanf May 26, 2020 16:31
)
val filter = (f:File) => {
val ext = f.extension(includeDot = false, includeAll = false).getOrElse("")
( ext == "gz" || ext == "xml" || ext == "ocs" || ext == "sign") && (f.isRegularFile && ageLimit.isAfter(f.lastModifiedTime.toEpochMilli))
Copy link
Member

Choose a reason for hiding this comment

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

i think we should have a set of authorized extensions, and just have to check if it contains it; I even believe we already have it somewhere.

Copy link
Member

Choose a reason for hiding this comment

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

yes, line 102: could you make it a value in the class ?
val authorizedExtensions = Set("gz", "xml", "ocs", "sign")

Copy link
Member

Choose a reason for hiding this comment

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

not sure where to defined it exactly, perhaps in object Watchers

@VinceMacBuche
Copy link
Member Author

PR updated with a new commit

@@ -79,10 +79,15 @@ final class Watchers(incoming: FileMonitor, updates: FileMonitor) {
}
object Watchers {

val inventoryExtentions = "gz" :: "xml" :: "ocs" :: "sign" :: Nil
Copy link
Member

Choose a reason for hiding this comment

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

it should be a set, it's done for that - but actually, for 4 elements, it's still special cased so it shouldn't matter at all.

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/3007
-- Your faithful QA
Kant merge: "Live your life as though your every act were to become a universal law."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/25220/console)

@fanf
Copy link
Member

fanf commented May 26, 2020

OK, squash merging this PR

@fanf fanf force-pushed the bug_17507/inventory_watcher_should_ignore_uuid_hive_file branch from 6abe988 to c3b5961 Compare May 26, 2020 21:07
@fanf fanf merged commit c3b5961 into Normation:branches/rudder/6.1 May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants