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

CLI: Specifying --profiles-path on check succeeds but displays usage error on archive #535

Closed
kevindickerson opened this issue Mar 10, 2016 · 4 comments · Fixed by #545
Closed

Comments

@kevindickerson
Copy link

CLI: Specifying --profiles-path on check succeeds but displays usage error on archive with our without --profiles-path argument.

Affected versions

  • inspec 0.15.0

To reproduce

Create a simple profile that inherits from an existing profile.

include_controls 'cis-rhel7-level1'

Checking the profile succeeds

$ chef exec inspec check prod_sec --profiles-path cis
Summary
-------
Location: prod_sec
Profile: pt-stuff
Controls: 188
Timestamp: 2016-03-10T13:42:06-08:00
Valid: true

Errors
------

Warnings
--------
controls/4_0_network_params_spec.rb:7:: Control cis-rhel7-level1/cis-network-params-4.1.1 has no description
controls/4_0_network_params_spec.rb:15:: Control cis-rhel7-level1/cis-network-params-4.1.2 has no description
controls/4_0_network_params_spec.rb:27:: Control cis-rhel7-level1/cis-network-params-4.2.1 has no description
controls/4_0_network_params_spec.rb:39:: Control cis-rhel7-level1/cis-network-params-4.2.2 has no description
controls/4_0_network_params_spec.rb:51:: Control cis-rhel7-level1/cis-network-params-4.2.3 has no description
controls/4_0_network_params_spec.rb:63:: Control cis-rhel7-level1/cis-network-params-4.2.4 has no description
controls/4_0_network_params_spec.rb:75:: Control cis-rhel7-level1/cis-network-params-4.2.5 has no description
controls/4_0_network_params_spec.rb:83:: Control cis-rhel7-level1/cis-network-params-4.2.6 has no description
controls/4_0_network_params_spec.rb:91:: Control cis-rhel7-level1/cis-network-params-4.2.8 has no description
controls/4_0_network_params_spec.rb:99:: Control cis-rhel7-level1/cis-network-params-4.3.1 has no description
controls/4_0_network_params_spec.rb:107:: Control cis-rhel7-level1/cis-network-params-4.4.1.1 has no description
controls/4_0_network_params_spec.rb:119:: Control cis-rhel7-level1/cis-network-params-4.4.1.2 has no description
controls/4_0_network_params_spec.rb:131:: Control cis-rhel7-level1/cis-network-params-4.4.2 has no description
controls/4_0_network_params_spec.rb:143:: Control cis-rhel7-level1/cis-network-params-4.5.1 has no description
controls/4_0_network_params_spec.rb:151:: Control cis-rhel7-level1/cis-network-params-4.5.2 has no description
controls/4_0_network_params_spec.rb:159:: Control cis-rhel7-level1/cis-network-params-4.5.3 has no description
controls/4_0_network_params_spec.rb:167:: Control cis-rhel7-level1/cis-network-params-4.5.4 has no description
controls/4_0_network_params_spec.rb:175:: Control cis-rhel7-level1/cis-network-params-4.5.5 has no description
controls/4_0_network_params_spec.rb:183:: Control cis-rhel7-level1/cis-network-params-4.6.1 has no description
controls/4_0_network_params_spec.rb:191:: Control cis-rhel7-level1/cis-network-params-4.6.2 has no description
controls/4_0_network_params_spec.rb:199:: Control cis-rhel7-level1/cis-network-params-4.6.3 has no description
controls/4_0_network_params_spec.rb:207:: Control cis-rhel7-level1/cis-network-params-4.6.4 has no description
controls/4_0_network_params_spec.rb:215:: Control cis-rhel7-level1/cis-network-params-4.7 has no description
controls/8_0_warning_banner_spec.rb:41:: Control cis-rhel7-level1/cis-warning_banner-8.03 has no tests defined
controls/9_1_system_permissions_spec.rb:7:: Control cis-rhel7-level1/cis-fs_permissions-9.01.01 has no description
controls/9_1_system_permissions_spec.rb:7:: Control cis-rhel7-level1/cis-fs_permissions-9.01.01 has no tests defined
controls/9_1_system_permissions_spec.rb:62:: Control cis-rhel7-level1/cis-fs_permissions-9.01.07 has no description
controls/9_1_system_permissions_spec.rb:71:: Control cis-rhel7-level1/cis-fs_permissions-9.01.08 has no description
controls/9_1_system_permissions_spec.rb:80:: Control cis-rhel7-level1/cis-fs_permissions-9.01.09 has no description
controls/9_2_user_group_settings_spec.rb:79:: Control cis-rhel7-level1/cis-user_group-9.02.07 has no tests defined
controls/9_2_user_group_settings_spec.rb:112:: Control cis-rhel7-level1/cis-user_group-9.02.09 has no tests defined
controls/9_2_user_group_settings_spec.rb:128:: Control cis-rhel7-level1/cis-user_group-9.02.10 has no tests defined
controls/9_2_user_group_settings_spec.rb:139:: Control cis-rhel7-level1/cis-user_group-9.02.11 has no tests defined
controls/9_2_user_group_settings_spec.rb:150:: Control cis-rhel7-level1/cis-user_group-9.02.12 has no tests defined
controls/9_2_user_group_settings_spec.rb:161:: Control cis-rhel7-level1/cis-user_group-9.02.13 has no tests defined
controls/9_2_user_group_settings_spec.rb:218:: Control cis-rhel7-level1/cis-user_group-9.02.19 has no tests defined
controls/9_2_user_group_settings_spec.rb:229:: Control cis-rhel7-level1/cis-user_group-9.02.20 has no tests defined

Archiving the profile fails with --profiles-path argument

$ chef exec inspec archive prod_sec --zip --profiles-path cis
ERROR: "inspec archive" was called with arguments ["prod_sec", "--profiles-path", "cis"]
Usage: "inspec archive PATH"

Archiving the profile fails without --profiles-path argument

$ chef exec inspec archive prod_sec --zip
I, [2016-03-10T13:34:50.409433 #9004]  INFO -- : Checking profile in prod_sec
I, [2016-03-10T13:34:50.415489 #9004]  INFO -- : Metadata OK.
C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/dsl.rb:98:in `get_reference_profile': You must supply a --profiles-path to inherit from other profiles. (RuntimeError)
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/dsl.rb:67:in `load_spec_files_for_profile'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/dsl.rb:15:in `include_controls'
        from prod_sec/controls/pt_rhel.rb:3:in `load'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/profile_context.rb:37:in `instance_eval'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/profile_context.rb:37:in `load'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/runner.rb:86:in `add_content'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/runner.rb:66:in `block in add_profile'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/runner.rb:63:in `each'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/runner.rb:63:in `add_profile'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/profile.rb:238:in `load_params'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/profile.rb:53:in `params'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/profile.rb:171:in `rules_count'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/lib/inspec/profile.rb:140:in `check'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/bin/inspec:94:in `archive'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/gems/inspec-0.15.0/bin/inspec:165:in `<top (required)>'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/bin/inspec:22:in `load'
        from C:/Users/lewisd01/AppData/Local/chefdk/gem/ruby/2.1.0/bin/inspec:22:in `<main>'
@kevindickerson kevindickerson changed the title CLI: Specifying --profiles-path on check succeeds but displays usage error on archive CLI: Specifying --profiles-path on check succeeds but displays usage error on archive Mar 10, 2016
@arlimus
Copy link
Contributor

arlimus commented Mar 16, 2016

Hi @kevindickerson , sorry we took a bit longer. I noticed that we had an issue with these functional tests, which are now addressed ^^. I'll add the fix for this issue next.

@kevindickerson
Copy link
Author

Awesome!!! Thanks @arlimus !! 👍

@arlimus
Copy link
Contributor

arlimus commented Mar 16, 2016

Once that's in, it'll be this branch: https://github.com/chef/inspec/compare/dr/check-check

@kevindickerson
Copy link
Author

Cool! Thank you!

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 a pull request may close this issue.

2 participants