hammer_cli_foreman 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/foreman.yml +4 -0
- data/doc/release_notes.md +21 -5
- data/lib/hammer_cli_foreman/api/connection.rb +14 -5
- data/lib/hammer_cli_foreman/api/interactive_basic_auth.rb +17 -5
- data/lib/hammer_cli_foreman/api/session_authenticator_wrapper.rb +27 -8
- data/lib/hammer_cli_foreman/auth.rb +14 -10
- data/lib/hammer_cli_foreman/auth_source_ldap.rb +38 -34
- data/lib/hammer_cli_foreman/compute_resource.rb +24 -0
- data/lib/hammer_cli_foreman/filter.rb +6 -2
- data/lib/hammer_cli_foreman/host.rb +2 -7
- data/lib/hammer_cli_foreman/hostgroup.rb +1 -0
- data/lib/hammer_cli_foreman/id_resolver.rb +27 -7
- data/lib/hammer_cli_foreman/location.rb +1 -0
- data/lib/hammer_cli_foreman/organization.rb +1 -0
- data/lib/hammer_cli_foreman/references.rb +10 -2
- data/lib/hammer_cli_foreman/smart_class_parameter.rb +10 -1
- data/lib/hammer_cli_foreman/smart_variable.rb +24 -16
- data/lib/hammer_cli_foreman/subnet.rb +33 -3
- data/lib/hammer_cli_foreman/template.rb +1 -1
- data/lib/hammer_cli_foreman/testing/api_expectations.rb +3 -1
- data/lib/hammer_cli_foreman/user.rb +37 -3
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/test/functional/filter_test.rb +146 -0
- data/test/functional/host_test.rb +12 -0
- data/test/functional/smart_variable_test.rb +4 -4
- data/test/functional/template_test.rb +20 -0
- data/test/functional/user_test.rb +13 -13
- data/test/unit/api/interactive_basic_auth_test.rb +18 -0
- data/test/unit/api/session_authenticator_wrapper_test.rb +72 -2
- data/test/unit/apipie_resource_mock.rb +3 -0
- data/test/unit/auth_source_ldap_test.rb +2 -3
- data/test/unit/commands_test.rb +1 -1
- data/test/unit/compute_resource_test.rb +24 -0
- data/test/unit/host_test.rb +1 -1
- data/test/unit/hostgroup_test.rb +1 -1
- data/test/unit/id_resolver_test.rb +59 -21
- data/test/unit/subnet_test.rb +1 -0
- data/test/unit/user_test.rb +7 -1
- metadata +35 -33
    
        data/test/unit/subnet_test.rb
    CHANGED
    
    | @@ -44,6 +44,7 @@ describe HammerCLIForeman::Subnet do | |
| 44 44 | 
             
                  with_params ["--name=subnet"] do
         | 
| 45 45 | 
             
                    it_should_print_n_records 1
         | 
| 46 46 | 
             
                    it_should_print_columns ["Id", "Name", "Network", "Mask"]
         | 
| 47 | 
            +
                    it_should_print_columns ["Description"]
         | 
| 47 48 | 
             
                    it_should_print_columns ["Priority"]
         | 
| 48 49 | 
             
                    it_should_print_columns ["DNS", "Primary DNS", "Secondary DNS"]
         | 
| 49 50 | 
             
                    it_should_print_columns ["Domains", "TFTP", "DHCP"]
         | 
    
        data/test/unit/user_test.rb
    CHANGED
    
    | @@ -24,7 +24,7 @@ describe HammerCLIForeman::User do | |
| 24 24 | 
             
                context "output" do
         | 
| 25 25 | 
             
                  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
         | 
| 26 26 | 
             
                  it_should_print_n_records
         | 
| 27 | 
            -
                  it_should_print_columns ["Id", "Login", "Name", "Email"]
         | 
| 27 | 
            +
                  it_should_print_columns ["Id", "Login", "Name", "Email", "Admin", "Last login", "Authorized by"]
         | 
| 28 28 | 
             
                end
         | 
| 29 29 |  | 
| 30 30 | 
             
              end
         | 
| @@ -88,7 +88,13 @@ describe HammerCLIForeman::User do | |
| 88 88 |  | 
| 89 89 | 
             
                let(:cmd) { cmd_module::UpdateCommand.new("", ctx) }
         | 
| 90 90 |  | 
| 91 | 
            +
                before :each do
         | 
| 92 | 
            +
                  HammerCLIForeman::User::CommonUpdateOptions.stubs(:ask_password).returns("password")
         | 
| 93 | 
            +
                end
         | 
| 94 | 
            +
             | 
| 91 95 | 
             
                context "parameters" do
         | 
| 96 | 
            +
                  it_should_accept "password and current password interactively", ["--login=jane", "--ask-password=true"]
         | 
| 97 | 
            +
                  it_should_fail_with "password change interactively with wrong current password", ["--login=jane","--ask-password=true", "--current-password=wrongpassword" ]
         | 
| 92 98 | 
             
                  it_should_accept "id", ["--id=1"]
         | 
| 93 99 | 
             
                  it_should_accept "login", ["--login=admin"]
         | 
| 94 100 | 
             
                  # it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: hammer_cli_foreman
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.11.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tomáš Strachota
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2017- | 
| 12 | 
            +
            date: 2017-08-01 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: hammer_cli
         | 
| @@ -17,14 +17,14 @@ dependencies: | |
| 17 17 | 
             
                requirements:
         | 
| 18 18 | 
             
                - - ">="
         | 
| 19 19 | 
             
                  - !ruby/object:Gem::Version
         | 
| 20 | 
            -
                    version: 0. | 
| 20 | 
            +
                    version: 0.11.0
         | 
| 21 21 | 
             
              type: :runtime
         | 
| 22 22 | 
             
              prerelease: false
         | 
| 23 23 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 24 24 | 
             
                requirements:
         | 
| 25 25 | 
             
                - - ">="
         | 
| 26 26 | 
             
                  - !ruby/object:Gem::Version
         | 
| 27 | 
            -
                    version: 0. | 
| 27 | 
            +
                    version: 0.11.0
         | 
| 28 28 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 29 29 | 
             
              name: apipie-bindings
         | 
| 30 30 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -72,8 +72,8 @@ extra_rdoc_files: | |
| 72 72 | 
             
            - doc/host_create.md
         | 
| 73 73 | 
             
            - doc/configuration.md
         | 
| 74 74 | 
             
            - doc/developer_docs.md
         | 
| 75 | 
            -
            - doc/testing.md
         | 
| 76 75 | 
             
            - doc/release_notes.md
         | 
| 76 | 
            +
            - doc/testing.md
         | 
| 77 77 | 
             
            - README.md
         | 
| 78 78 | 
             
            files:
         | 
| 79 79 | 
             
            - LICENSE
         | 
| @@ -182,6 +182,7 @@ files: | |
| 182 182 | 
             
            - test/data/1.15/foreman_api.json
         | 
| 183 183 | 
             
            - test/data/README.md
         | 
| 184 184 | 
             
            - test/functional/commands/list_test.rb
         | 
| 185 | 
            +
            - test/functional/filter_test.rb
         | 
| 185 186 | 
             
            - test/functional/host_test.rb
         | 
| 186 187 | 
             
            - test/functional/hostgroup/create_test.rb
         | 
| 187 188 | 
             
            - test/functional/hostgroup/update_test.rb
         | 
| @@ -279,14 +280,17 @@ test_files: | |
| 279 280 | 
             
            - test/functional/smart_class_parameter_test.rb
         | 
| 280 281 | 
             
            - test/functional/hostgroup/create_test.rb
         | 
| 281 282 | 
             
            - test/functional/hostgroup/update_test.rb
         | 
| 282 | 
            -
            - test/functional/ | 
| 283 | 
            -
            - test/functional/user_test.rb
         | 
| 284 | 
            -
            - test/functional/template_test.rb
         | 
| 283 | 
            +
            - test/functional/host_test.rb
         | 
| 285 284 | 
             
            - test/functional/role_test.rb
         | 
| 286 285 | 
             
            - test/functional/test_helper.rb
         | 
| 287 | 
            -
            - test/functional/ | 
| 286 | 
            +
            - test/functional/filter_test.rb
         | 
| 287 | 
            +
            - test/functional/template_test.rb
         | 
| 288 | 
            +
            - test/functional/user_test.rb
         | 
| 289 | 
            +
            - test/functional/smart_variable_test.rb
         | 
| 288 290 | 
             
            - test/unit/api_test.rb
         | 
| 289 | 
            -
            - test/unit/ | 
| 291 | 
            +
            - test/unit/model_test.rb
         | 
| 292 | 
            +
            - test/unit/puppet_class_test.rb
         | 
| 293 | 
            +
            - test/unit/realm_test.rb
         | 
| 290 294 | 
             
            - test/unit/defaults_test.rb
         | 
| 291 295 | 
             
            - test/unit/data/test_api.json
         | 
| 292 296 | 
             
            - test/unit/dependency_resolver_test.rb
         | 
| @@ -295,42 +299,40 @@ test_files: | |
| 295 299 | 
             
            - test/unit/helpers/fake_searchables.rb
         | 
| 296 300 | 
             
            - test/unit/helpers/resource_disabled.rb
         | 
| 297 301 | 
             
            - test/unit/helpers/command.rb
         | 
| 298 | 
            -
            - test/unit/ | 
| 299 | 
            -
            - test/unit/ | 
| 302 | 
            +
            - test/unit/report_test.rb
         | 
| 303 | 
            +
            - test/unit/subnet_test.rb
         | 
| 300 304 | 
             
            - test/unit/option_builders_test.rb
         | 
| 301 305 | 
             
            - test/unit/output/formatters_test.rb
         | 
| 302 306 | 
             
            - test/unit/param_filters_test.rb
         | 
| 303 307 | 
             
            - test/unit/role_test.rb
         | 
| 304 | 
            -
            - test/unit/ | 
| 308 | 
            +
            - test/unit/hostgroup_test.rb
         | 
| 305 309 | 
             
            - test/unit/test_helper.rb
         | 
| 306 310 | 
             
            - test/unit/test_output_adapter.rb
         | 
| 307 311 | 
             
            - test/unit/location_test.rb
         | 
| 308 | 
            -
            - test/unit/ | 
| 309 | 
            -
            - test/unit/ | 
| 312 | 
            +
            - test/unit/smart_variable_test.rb
         | 
| 313 | 
            +
            - test/unit/template_test.rb
         | 
| 314 | 
            +
            - test/unit/usergroup_test.rb
         | 
| 315 | 
            +
            - test/unit/common_parameter_test.rb
         | 
| 310 316 | 
             
            - test/unit/operating_system_test.rb
         | 
| 311 | 
            -
            - test/unit/architecture_test.rb
         | 
| 312 | 
            -
            - test/unit/auth_source_ldap_test.rb
         | 
| 313 | 
            -
            - test/unit/config_group_test.rb
         | 
| 314 317 | 
             
            - test/unit/environment_test.rb
         | 
| 315 | 
            -
            - test/unit/filter_test.rb
         | 
| 316 318 | 
             
            - test/unit/host_test.rb
         | 
| 317 | 
            -
            - test/unit/ | 
| 318 | 
            -
            - test/unit/ | 
| 319 | 
            -
            - test/unit/ | 
| 320 | 
            -
            - test/unit/ | 
| 321 | 
            -
            - test/unit/ | 
| 322 | 
            -
            - test/unit/ | 
| 319 | 
            +
            - test/unit/config_group_test.rb
         | 
| 320 | 
            +
            - test/unit/filter_test.rb
         | 
| 321 | 
            +
            - test/unit/compute_resource_test.rb
         | 
| 322 | 
            +
            - test/unit/auth_source_ldap_test.rb
         | 
| 323 | 
            +
            - test/unit/domain_test.rb
         | 
| 324 | 
            +
            - test/unit/id_resolver_test.rb
         | 
| 323 325 | 
             
            - test/unit/organization_test.rb
         | 
| 324 326 | 
             
            - test/unit/smart_class_parameter_test.rb
         | 
| 325 327 | 
             
            - test/unit/api/interactive_basic_auth_test.rb
         | 
| 326 328 | 
             
            - test/unit/api/session_authenticator_wrapper_test.rb
         | 
| 327 | 
            -
            - test/unit/ | 
| 328 | 
            -
            - test/unit/ | 
| 329 | 
            -
            - test/unit/ | 
| 330 | 
            -
            - test/unit/ | 
| 331 | 
            -
            - test/unit/ | 
| 332 | 
            -
            - test/unit/ | 
| 333 | 
            -
            - test/unit/ | 
| 334 | 
            -
            - test/unit/id_resolver_test.rb
         | 
| 329 | 
            +
            - test/unit/architecture_test.rb
         | 
| 330 | 
            +
            - test/unit/apipie_resource_mock.rb
         | 
| 331 | 
            +
            - test/unit/commands_test.rb
         | 
| 332 | 
            +
            - test/unit/exception_handler_test.rb
         | 
| 333 | 
            +
            - test/unit/image_test.rb
         | 
| 334 | 
            +
            - test/unit/media_test.rb
         | 
| 335 | 
            +
            - test/unit/partition_table_test.rb
         | 
| 335 336 | 
             
            - test/unit/smart_proxy_test.rb
         | 
| 337 | 
            +
            - test/unit/user_test.rb
         | 
| 336 338 | 
             
            - test/test_helper.rb
         |