Skip to content
This repository was archived by the owner on Jul 18, 2018. It is now read-only.
This repository was archived by the owner on Jul 18, 2018. It is now read-only.

Add check to ensure correct parameters are passed to rules #20

@daltonmatos

Description

@daltonmatos

Currently all rules requires one parameter. This parameter is passed with the --ruleparam CLI argument. The problem is that when this argument is not passed, the rule is called with (None,). This is specially dangerous for the oltderthan rule, because with None as a rule parameter it will potentially delete all container content.

This happens because any integer returns True when compared do None, so:

    ...
    delta = (datetime.now() - objdate)
    return delta.days > ndays

When ndays is None this will always return True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions