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 #14158 - Use tailoring file for scan #18
Conversation
def run(policy_id) | ||
@policy_id = policy_id | ||
ensure_policy_exist | ||
load_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting following, because ensure_policy_exist on line above requires config to be present already
/usr/local/share/gems/gems/foreman_scap_client-0.3.0/lib/foreman_scap_client/client.rb:131:in `ensure_policy_exist': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/local/share/gems/gems/foreman_scap_client-0.3.0/lib/foreman_scap_client/client.rb:16:in `run'
from /usr/local/share/gems/gems/foreman_scap_client-0.3.0/bin/foreman_scap_client:10:in `<top (required)>'
from /usr/bin/foreman_scap_client:23:in `load'
from /usr/bin/foreman_scap_client:23:in `<main>'
This change should bump the version to 0.3.0, we should remember to bump it after the change. |
7e2412e
to
68e5d04
Compare
Updated, should be ok now. |
@config ||= YAML.load_file(CONFIG_FILE) | ||
@tailored = !@config[policy_id][:tailoring_path].empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also handle the case that this option is not there yet (so can be nil
) to be compatible with older version of puppet-foreman_scap_client/foreman_openscap or in case the puppet module haven't reconfigured the client yet.
I moved the check for existing policy into the method that loads the config. |
Works fine now. |
Merging ... |
No description provided.