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 #14158 - Use tailoring file for scan #18

Merged
merged 1 commit into from Jan 6, 2017

Conversation

xprazak2
Copy link
Contributor

No description provided.

def run(policy_id)
@policy_id = policy_id
ensure_policy_exist
load_config
Copy link
Member

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>'

@ares
Copy link
Member

ares commented Nov 22, 2016

This change should bump the version to 0.3.0, we should remember to bump it after the change.

@xprazak2 xprazak2 force-pushed the tailoring branch 2 times, most recently from 7e2412e to 68e5d04 Compare November 26, 2016 13:56
@xprazak2
Copy link
Contributor Author

Updated, should be ok now.

@config ||= YAML.load_file(CONFIG_FILE)
@tailored = !@config[policy_id][:tailoring_path].empty?
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 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.

@xprazak2
Copy link
Contributor Author

xprazak2 commented Dec 7, 2016

I moved the check for existing policy into the method that loads the config.

@ares
Copy link
Member

ares commented Dec 23, 2016

Works fine now.

@shlomizadok
Copy link
Member

Merging ...
Thank you @xprazak2 !!

@shlomizadok shlomizadok merged commit 74f45fa into theforeman:master Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants