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

build_remediations.py: deduplicate code which retrieves conditionals #9779

Commits on Nov 8, 2022

  1. unify definition of remediatiojObject

    RemediationObject is a namedtuple.
    Before it was defined on several places.
    Now it has one definition and the definition is reused.
    vojtapolasek committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    9b1045a View commit details
    Browse the repository at this point in the history
  2. extract functions for getting platform names and cpe names related to…

    … remediations
    
    This commit deduplicates code.
    There are two new pairs of functions created.
    Two functions to get platform names of inherited conditionals or rule-specific conditionals.
    These platform names can be used in the remaining two functions to get actual conditionals.
    Then there is another function which strips conditionals of whitespaces at their begining or end.
    These functions are used in BashRemediation and AnsibleRemediation class.
    vojtapolasek committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    ecf2707 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cff3f30 View commit details
    Browse the repository at this point in the history
  4. merge two if statements

    as reported by Code climate
    vojtapolasek committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    505c061 View commit details
    Browse the repository at this point in the history