hammer_cli_foreman 0.6.2 → 0.7.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/host_create.md +4 -4
- data/doc/release_notes.md +24 -6
- data/lib/hammer_cli_foreman/associating_commands.rb +54 -0
- data/lib/hammer_cli_foreman/commands.rb +28 -7
- data/lib/hammer_cli_foreman/exception_handler.rb +18 -0
- data/lib/hammer_cli_foreman/exceptions.rb +1 -1
- data/lib/hammer_cli_foreman/host.rb +11 -6
- data/lib/hammer_cli_foreman/id_resolver.rb +10 -2
- data/lib/hammer_cli_foreman/partition_table.rb +1 -0
- data/lib/hammer_cli_foreman/smart_class_parameter.rb +5 -1
- data/lib/hammer_cli_foreman/smart_variable.rb +1 -1
- data/lib/hammer_cli_foreman/template.rb +29 -5
- data/lib/hammer_cli_foreman/testing/api_expectations.rb +6 -6
- data/lib/hammer_cli_foreman/user.rb +2 -1
- data/lib/hammer_cli_foreman/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ca/hammer-cli-foreman.edit.po +2622 -0
- data/locale/ca/hammer-cli-foreman.po +2544 -0
- data/locale/ca/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/de/hammer-cli-foreman.edit.po +2613 -0
- data/locale/de/hammer-cli-foreman.po +132 -122
- data/locale/de/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en/hammer-cli-foreman.edit.po +2575 -0
- data/locale/en/hammer-cli-foreman.po +157 -8
- data/locale/en/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/en_GB/hammer-cli-foreman.edit.po +2582 -0
- data/locale/en_GB/hammer-cli-foreman.po +151 -141
- data/locale/en_GB/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/es/hammer-cli-foreman.edit.po +2625 -0
- data/locale/es/hammer-cli-foreman.po +110 -100
- data/locale/es/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/fr/hammer-cli-foreman.edit.po +2626 -0
- data/locale/fr/hammer-cli-foreman.po +110 -100
- data/locale/fr/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/hammer-cli-foreman.pot +390 -190
- data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/it/hammer-cli-foreman.edit.po +2601 -0
- data/locale/it/hammer-cli-foreman.po +139 -129
- data/locale/it/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ja/hammer-cli-foreman.edit.po +2601 -0
- data/locale/ja/hammer-cli-foreman.po +140 -130
- data/locale/ja/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ko/hammer-cli-foreman.edit.po +2599 -0
- data/locale/ko/hammer-cli-foreman.po +138 -128
- data/locale/ko/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/pt_BR/hammer-cli-foreman.edit.po +2628 -0
- data/locale/pt_BR/hammer-cli-foreman.po +112 -102
- data/locale/pt_BR/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/ru/hammer-cli-foreman.edit.po +2602 -0
- data/locale/ru/hammer-cli-foreman.po +265 -254
- data/locale/ru/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_CN/hammer-cli-foreman.edit.po +2599 -0
- data/locale/zh_CN/hammer-cli-foreman.po +136 -126
- data/locale/zh_CN/hammer-cli-foreman.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
- data/locale/zh_TW/hammer-cli-foreman.edit.po +2599 -0
- data/locale/zh_TW/hammer-cli-foreman.po +137 -127
- data/locale/zh_TW/hammer-cli-foreman.po.time_stamp +0 -0
- data/test/data/README.md +6 -1
- data/test/functional/commands/list_test.rb +141 -0
- data/test/functional/organization_test.rb +71 -0
- data/test/functional/smart_class_parameter_test.rb +61 -0
- data/test/functional/template_test.rb +80 -0
- data/test/functional/test_helper.rb +3 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-InfoCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Architecture.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-SetCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter-SetCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-CommonParameter.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-CreateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ComputeResource.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-InfoCommand-output.xml +21 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-SetParameterCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Domain-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Domain.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Environment-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Environment.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-ExceptionHandler.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Host-CreateCommand-parameters.xml +46 -0
- data/test/reports/TEST-HammerCLIForeman-Host-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Host-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-InfoCommand-output.xml +85 -0
- data/test/reports/TEST-HammerCLIForeman-Host-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Host-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-ListCommand-output.xml +21 -0
- data/test/reports/TEST-HammerCLIForeman-Host-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Host-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-PuppetRunCommand-output.xml +9 -0
- data/test/reports/TEST-HammerCLIForeman-Host-PuppetRunCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-SetParameterCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Host-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-StatusCommand-output.xml +9 -0
- data/test/reports/TEST-HammerCLIForeman-Host-StatusCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host-UpdateCommand-parameters.xml +40 -0
- data/test/reports/TEST-HammerCLIForeman-Host-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Host.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteParameterCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-InfoCommand-output.xml +29 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-InfoCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-ListCommand-output.xml +27 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-SetParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-UpdateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Hostgroup.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-CreateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Location-DeleteCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Location-UpdateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Location-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Location.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-CreateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-InfoCommand-output.xml +23 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-UpdateCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Medium-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Medium.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteParameterCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-DeleteParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-InfoCommand-output.xml +27 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-ListCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-SetParameterCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-SetParameterCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-UpdateCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-OperatingSystem.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-CreateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-CreateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-DeleteCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand-output.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-UpdateCommand-resource-disabled.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Organization-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Organization.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-CreateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DumpCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-DumpCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-InfoCommand-output.xml +19 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-UpdateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-PartitionTable.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-CreateCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-InfoCommand-output.xml +21 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-ListCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-SmartProxy.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-CreateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-DeleteCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-InfoCommand-output.xml +43 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-InfoCommand-parameters.xml +13 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-ListCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-UpdateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Subnet.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-CreateCommand-parameters.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Template-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DumpCommand-parameters.xml +12 -0
- data/test/reports/TEST-HammerCLIForeman-Template-DumpCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-InfoCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Template-InfoCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Template-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListCommand-output.xml +15 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListKindsCommand-parameters.xml +9 -0
- data/test/reports/TEST-HammerCLIForeman-Template-ListKindsCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template-UpdateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-Template-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-Template.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-CreateCommand-parameters.xml +19 -0
- data/test/reports/TEST-HammerCLIForeman-User-CreateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-DeleteCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-User-DeleteCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-InfoCommand-output.xml +23 -0
- data/test/reports/TEST-HammerCLIForeman-User-InfoCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-User-InfoCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-ListCommand-output.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-User-ListCommand-parameters.xml +17 -0
- data/test/reports/TEST-HammerCLIForeman-User-ListCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User-UpdateCommand-parameters.xml +11 -0
- data/test/reports/TEST-HammerCLIForeman-User-UpdateCommand.xml +7 -0
- data/test/reports/TEST-HammerCLIForeman-User.xml +7 -0
- data/test/reports/TEST-MiniTest-Spec.xml +7 -0
- data/test/unit/commands_test.rb +9 -9
- data/test/unit/data/test_api.json +43 -0
- data/test/unit/exception_handler_test.rb +20 -1
- data/test/unit/host_test.rb +12 -0
- data/test/unit/id_resolver_test.rb +18 -2
- data/test/unit/user_test.rb +1 -1
- metadata +561 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d452c453ff4c1d71b981aa86267a97d57ad5af89
|
|
4
|
+
data.tar.gz: 1c3a7f0a5e69bd24c75bddfc0a82ebe3c42c2143
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0a501559d4630e4cb23e0761ec3172ef9e4152e8594abdafa04adf348a0794da761380c21f5534725385f71a8b891f59740d2b80027e45a6d70dc150328bc4b9
|
|
7
|
+
data.tar.gz: fc59ef6ba743c661725412edd411d91f30cee6f37beeaad218fe3c8a2a13f40ea232a56e1f81f45b3e8a726e9a057594a0179156317f69acea470107b3323de0
|
data/config/foreman.yml
CHANGED
|
@@ -14,3 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
# API request timeout. Set to -1 for no timeout
|
|
16
16
|
#:request_timeout: 120 #seconds
|
|
17
|
+
|
|
18
|
+
# Follow API redirects. One of :never, :default, :always
|
|
19
|
+
# Value :default means RestClient default behaviour - follow only in GET and HEAD requests
|
|
20
|
+
#:follow_redirects: :never
|
data/doc/host_create.md
CHANGED
|
@@ -169,7 +169,7 @@ start # boolean, whether to start the machine or not
|
|
|
169
169
|
|
|
170
170
|
Available keys for `--interface`:
|
|
171
171
|
```
|
|
172
|
-
compute_type # one of [
|
|
172
|
+
compute_type # one of [bridge, network]
|
|
173
173
|
compute_network / compute_bridge # name of interface according to type
|
|
174
174
|
compute_model # one of [virtio, rtl8139, ne2k_pci, pcnet, e1000]
|
|
175
175
|
```
|
|
@@ -231,9 +231,9 @@ memory_mb # integer number
|
|
|
231
231
|
cluster # cluster id from VMware
|
|
232
232
|
path # path to folder
|
|
233
233
|
guest_id # guest OS id form VMware
|
|
234
|
-
scsi_controller_type # id of the controller from
|
|
235
|
-
hardware_version # hardware version id from
|
|
236
|
-
start # 1
|
|
234
|
+
scsi_controller_type # id of the controller from VMware
|
|
235
|
+
hardware_version # hardware version id from VMware
|
|
236
|
+
start # Must be a 1 or 0, whether to start the machine or not
|
|
237
237
|
```
|
|
238
238
|
|
|
239
239
|
Available keys for `--interface`:
|
data/doc/release_notes.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
Release notes
|
|
2
2
|
=============
|
|
3
3
|
|
|
4
|
-
### 0.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
4
|
+
### 0.7.0 (2016-06-14)
|
|
5
|
+
* Let print adapters decide whether to paginate ([#15257](http://projects.theforeman.org/issues/15257))
|
|
6
|
+
* Forbid setting smart param override value and puppet default ([#13832](http://projects.theforeman.org/issues/13832))
|
|
7
|
+
* Add rebuild config option for host ([PR#231](https://github.com/theforeman/hammer-cli-foreman/pull/231)) ([#12103](http://projects.theforeman.org/issues/12103))
|
|
8
|
+
* Removing wrong colons from host create docs
|
|
9
|
+
* i18n - remove underscore from override value error message
|
|
10
|
+
* Typo in MissingSeachOptions ([#14007](http://projects.theforeman.org/issues/14007))
|
|
11
|
+
* Add Catalan language ([#14947](http://projects.theforeman.org/issues/14947))
|
|
12
|
+
* Hammer shows incorrect admin status when assign admin role using user group ([#14606](http://projects.theforeman.org/issues/14606))
|
|
13
|
+
* Fixed response parsing for puppetclasses parameter ([#14930](http://projects.theforeman.org/issues/14930))
|
|
14
|
+
* Display locked flag for templates and ptables ([#14943](http://projects.theforeman.org/issues/14943))
|
|
15
|
+
* Document vmware `start` parameter
|
|
16
|
+
* Fixes VMware name in docs for host create
|
|
17
|
+
* Respect per_page set in config file ([#14530](http://projects.theforeman.org/issues/14530))
|
|
18
|
+
* Provide success/failure message for associating commands ([#7492](http://projects.theforeman.org/issues/7492))
|
|
19
|
+
* Add support for Gemfile.local.rb ([#14466](http://projects.theforeman.org/issues/14466))
|
|
20
|
+
* Fixing path in docs for generated test json ([PR#226](https://github.com/theforeman/hammer-cli-foreman/pull/226))
|
|
21
|
+
* Added clone command to config templates ([#13946](http://projects.theforeman.org/issues/13946))
|
|
22
|
+
* Handle API request redirects with useful message ([#11147](http://projects.theforeman.org/issues/11147))
|
|
23
|
+
* Newer version of apipie validates types for arrays ([#13966](http://projects.theforeman.org/issues/13966))
|
|
24
|
+
* Show auth source name for all auth sources ([#7468](http://projects.theforeman.org/issues/7468))
|
|
25
|
+
* Environment and Puppet proxy is not required ([#13926](http://projects.theforeman.org/issues/13926))
|
|
26
|
+
* Added special method for dealing with puppetclasses ([#11880](http://projects.theforeman.org/issues/11880))
|
|
27
|
+
* Make primary and provision flag optional ([#13927](http://projects.theforeman.org/issues/13927))
|
|
10
28
|
|
|
11
29
|
### 0.6.0 (2016-02-25)
|
|
12
30
|
* Names of sc-params are immutable ([#13830](http://projects.theforeman.org/issues/13830))
|
|
@@ -39,11 +39,17 @@ module HammerCLIForeman
|
|
|
39
39
|
class AddHostgroupCommand < HammerCLIForeman::AddAssociatedCommand
|
|
40
40
|
associated_resource :hostgroups
|
|
41
41
|
desc _("Associate a hostgroup")
|
|
42
|
+
|
|
43
|
+
success_message _("The hostgroup has been associated")
|
|
44
|
+
failure_message _("Could not associate the hostgroup")
|
|
42
45
|
end
|
|
43
46
|
|
|
44
47
|
class RemoveHostgroupCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
45
48
|
associated_resource :hostgroups
|
|
46
49
|
desc _("Disassociate a hostgroup")
|
|
50
|
+
|
|
51
|
+
success_message _("The hostgroup has been disassociated")
|
|
52
|
+
failure_message _("Could not disassociate the hostgroup")
|
|
47
53
|
end
|
|
48
54
|
end
|
|
49
55
|
|
|
@@ -53,11 +59,17 @@ module HammerCLIForeman
|
|
|
53
59
|
class AddEnvironmentCommand < HammerCLIForeman::AddAssociatedCommand
|
|
54
60
|
associated_resource :environments
|
|
55
61
|
desc _("Associate an environment")
|
|
62
|
+
|
|
63
|
+
success_message _("The environment has been associated")
|
|
64
|
+
failure_message _("Could not associate the environment")
|
|
56
65
|
end
|
|
57
66
|
|
|
58
67
|
class RemoveEnvironmentCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
59
68
|
associated_resource :environments
|
|
60
69
|
desc _("Disassociate an environment")
|
|
70
|
+
|
|
71
|
+
success_message _("The environment has been disassociated")
|
|
72
|
+
failure_message _("Could not disassociate the environment")
|
|
61
73
|
end
|
|
62
74
|
end
|
|
63
75
|
|
|
@@ -67,11 +79,17 @@ module HammerCLIForeman
|
|
|
67
79
|
class AddDomainCommand < HammerCLIForeman::AddAssociatedCommand
|
|
68
80
|
associated_resource :domains
|
|
69
81
|
desc _("Associate a domain")
|
|
82
|
+
|
|
83
|
+
success_message _("The domain has been associated")
|
|
84
|
+
failure_message _("Could not associate the domain")
|
|
70
85
|
end
|
|
71
86
|
|
|
72
87
|
class RemoveDomainCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
73
88
|
associated_resource :domains
|
|
74
89
|
desc _("Disassociate a domain")
|
|
90
|
+
|
|
91
|
+
success_message _("The domain has been disassociated")
|
|
92
|
+
failure_message _("Could not disassociate the domain")
|
|
75
93
|
end
|
|
76
94
|
end
|
|
77
95
|
|
|
@@ -81,11 +99,17 @@ module HammerCLIForeman
|
|
|
81
99
|
class AddMediumCommand < HammerCLIForeman::AddAssociatedCommand
|
|
82
100
|
associated_resource :media
|
|
83
101
|
desc _("Associate a medium")
|
|
102
|
+
|
|
103
|
+
success_message _("The medium has been associated")
|
|
104
|
+
failure_message _("Could not associate the medium")
|
|
84
105
|
end
|
|
85
106
|
|
|
86
107
|
class RemoveMediumCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
87
108
|
associated_resource :media
|
|
88
109
|
desc _("Disassociate a medium")
|
|
110
|
+
|
|
111
|
+
success_message _("The medium has been disassociated")
|
|
112
|
+
failure_message _("Could not disassociate the medium")
|
|
89
113
|
end
|
|
90
114
|
end
|
|
91
115
|
|
|
@@ -95,11 +119,17 @@ module HammerCLIForeman
|
|
|
95
119
|
class AddSubnetCommand < HammerCLIForeman::AddAssociatedCommand
|
|
96
120
|
associated_resource :subnets
|
|
97
121
|
desc _("Associate a subnet")
|
|
122
|
+
|
|
123
|
+
success_message _("The subnet has been associated")
|
|
124
|
+
failure_message _("Could not associate the subnet")
|
|
98
125
|
end
|
|
99
126
|
|
|
100
127
|
class RemoveSubnetCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
101
128
|
associated_resource :subnets
|
|
102
129
|
desc _("Disassociate a subnet")
|
|
130
|
+
|
|
131
|
+
success_message _("The subnet has been disassociated")
|
|
132
|
+
failure_message _("Could not disassociate the subnet")
|
|
103
133
|
end
|
|
104
134
|
end
|
|
105
135
|
|
|
@@ -109,11 +139,17 @@ module HammerCLIForeman
|
|
|
109
139
|
class AddComputeResourceCommand < HammerCLIForeman::AddAssociatedCommand
|
|
110
140
|
associated_resource :compute_resources
|
|
111
141
|
desc _("Associate a compute resource")
|
|
142
|
+
|
|
143
|
+
success_message _("The compute resource has been associated")
|
|
144
|
+
failure_message _("Could not associate the compute resource")
|
|
112
145
|
end
|
|
113
146
|
|
|
114
147
|
class RemoveComputeResourceCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
115
148
|
associated_resource :compute_resources
|
|
116
149
|
desc _("Disassociate a compute resource")
|
|
150
|
+
|
|
151
|
+
success_message _("The compute resource has been disassociated")
|
|
152
|
+
failure_message _("Could not disassociate the compute resource")
|
|
117
153
|
end
|
|
118
154
|
end
|
|
119
155
|
|
|
@@ -124,6 +160,9 @@ module HammerCLIForeman
|
|
|
124
160
|
associated_resource :smart_proxies
|
|
125
161
|
desc _("Associate a smart proxy")
|
|
126
162
|
|
|
163
|
+
success_message _("The smart proxy has been associated")
|
|
164
|
+
failure_message _("Could not associate the smart proxy")
|
|
165
|
+
|
|
127
166
|
def associated_resource_name
|
|
128
167
|
"smart-proxy"
|
|
129
168
|
end
|
|
@@ -133,6 +172,9 @@ module HammerCLIForeman
|
|
|
133
172
|
associated_resource :smart_proxies
|
|
134
173
|
desc _("Disassociate a smart proxy")
|
|
135
174
|
|
|
175
|
+
success_message _("The smart proxy has been disassociated")
|
|
176
|
+
failure_message _("Could not disassociate the smart proxy")
|
|
177
|
+
|
|
136
178
|
def associated_resource_name
|
|
137
179
|
"smart-proxy"
|
|
138
180
|
end
|
|
@@ -189,11 +231,17 @@ module HammerCLIForeman
|
|
|
189
231
|
class AddConfigTemplateCommand < HammerCLIForeman::AddAssociatedCommand
|
|
190
232
|
associated_resource :config_templates
|
|
191
233
|
desc _("Associate a configuration template")
|
|
234
|
+
|
|
235
|
+
success_message _("The configuration template has been associated")
|
|
236
|
+
failure_message _("Could not associate the configuration template")
|
|
192
237
|
end
|
|
193
238
|
|
|
194
239
|
class RemoveConfigTemplateCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
195
240
|
associated_resource :config_templates
|
|
196
241
|
desc _("Disassociate a configuration template")
|
|
242
|
+
|
|
243
|
+
success_message _("The configuration template has been disassociated")
|
|
244
|
+
failure_message _("Could not disassociate the configuration template")
|
|
197
245
|
end
|
|
198
246
|
end
|
|
199
247
|
|
|
@@ -203,11 +251,17 @@ module HammerCLIForeman
|
|
|
203
251
|
class AddOrganizationCommand < HammerCLIForeman::AddAssociatedCommand
|
|
204
252
|
associated_resource :organizations
|
|
205
253
|
desc _("Associate an organization")
|
|
254
|
+
|
|
255
|
+
success_message _("The organization has been associated")
|
|
256
|
+
failure_message _("Could not associate the organization")
|
|
206
257
|
end
|
|
207
258
|
|
|
208
259
|
class RemoveOrganizationCommand < HammerCLIForeman::RemoveAssociatedCommand
|
|
209
260
|
associated_resource :organizations
|
|
210
261
|
desc _("Disassociate an organization")
|
|
262
|
+
|
|
263
|
+
success_message _("The organization has been disassociated")
|
|
264
|
+
failure_message _("Could not disassociate the organization")
|
|
211
265
|
end
|
|
212
266
|
end
|
|
213
267
|
|
|
@@ -25,6 +25,7 @@ module HammerCLIForeman
|
|
|
25
25
|
config[:credentials] = credentials
|
|
26
26
|
config[:logger] = Logging.logger['API']
|
|
27
27
|
config[:api_version] = 2
|
|
28
|
+
config[:follow_redirects] = HammerCLI::Settings.get(:foreman, :follow_redirects) || :never
|
|
28
29
|
config[:aggressive_cache_checking] = HammerCLI::Settings.get(:foreman, :refresh_cache) || false
|
|
29
30
|
config[:headers] = { "Accept-Language" => HammerCLI::I18n.locale }
|
|
30
31
|
config[:language] = HammerCLI::I18n.locale
|
|
@@ -151,7 +152,7 @@ module HammerCLIForeman
|
|
|
151
152
|
end
|
|
152
153
|
begin
|
|
153
154
|
resolver.send("#{resource.singular_name}_id", opts)
|
|
154
|
-
rescue HammerCLIForeman::
|
|
155
|
+
rescue HammerCLIForeman::MissingSearchOptions => e
|
|
155
156
|
if (options[:required] == true || resource_search_requested(resource, opts))
|
|
156
157
|
logger.info "Error occured while searching for #{resource.singular_name}"
|
|
157
158
|
raise e
|
|
@@ -163,7 +164,7 @@ module HammerCLIForeman
|
|
|
163
164
|
opts = resolver.scoped_options(resource.singular_name, all_options)
|
|
164
165
|
begin
|
|
165
166
|
resolver.send("#{resource.singular_name}_ids", opts)
|
|
166
|
-
rescue HammerCLIForeman::
|
|
167
|
+
rescue HammerCLIForeman::MissingSearchOptions => e
|
|
167
168
|
if (options[:required] == true || resource_search_requested(resource, opts, true))
|
|
168
169
|
logger.info "Error occured while searching for #{resource.name}"
|
|
169
170
|
raise e
|
|
@@ -187,7 +188,7 @@ module HammerCLIForeman
|
|
|
187
188
|
|
|
188
189
|
def send_request
|
|
189
190
|
transform_format(super)
|
|
190
|
-
rescue HammerCLIForeman::
|
|
191
|
+
rescue HammerCLIForeman::MissingSearchOptions => e
|
|
191
192
|
|
|
192
193
|
switches = self.class.find_options(:referenced_resource => e.resource.singular_name).map(&:long_switch)
|
|
193
194
|
|
|
@@ -199,7 +200,7 @@ module HammerCLIForeman
|
|
|
199
200
|
error_message = _("Could not find %{resource}, please set one of options %{switches}.")
|
|
200
201
|
end
|
|
201
202
|
|
|
202
|
-
raise
|
|
203
|
+
raise MissingSearchOptions.new(
|
|
203
204
|
error_message % {
|
|
204
205
|
:resource => e.resource.singular_name,
|
|
205
206
|
:switches => switches.join(", ")
|
|
@@ -327,7 +328,9 @@ module HammerCLIForeman
|
|
|
327
328
|
end
|
|
328
329
|
|
|
329
330
|
def should_retrieve_all?
|
|
330
|
-
pagination_supported? && option_per_page.nil? && option_page.nil?
|
|
331
|
+
retrieve_all = pagination_supported? && option_per_page.nil? && option_page.nil?
|
|
332
|
+
retrieve_all &&= HammerCLI::Settings.get(:ui, :per_page).nil? if output.adapter.paginate_by_default?
|
|
333
|
+
retrieve_all
|
|
331
334
|
end
|
|
332
335
|
|
|
333
336
|
end
|
|
@@ -475,6 +478,11 @@ module HammerCLIForeman
|
|
|
475
478
|
return superclass.associated_resource if superclass.respond_to? :associated_resource
|
|
476
479
|
end
|
|
477
480
|
|
|
481
|
+
def self.default_message(format)
|
|
482
|
+
name = associated_resource ? associated_resource.singular_name.to_s : nil
|
|
483
|
+
format % { :resource_name => name.gsub(/_|-/, ' ') } unless name.nil?
|
|
484
|
+
end
|
|
485
|
+
|
|
478
486
|
def get_associated_identifier
|
|
479
487
|
get_resource_id(associated_resource, :scoped => true)
|
|
480
488
|
end
|
|
@@ -521,6 +529,14 @@ module HammerCLIForeman
|
|
|
521
529
|
description.strip.empty? ? _("Associate a resource") : description
|
|
522
530
|
end
|
|
523
531
|
|
|
532
|
+
def self.failure_message(msg = nil)
|
|
533
|
+
super(msg) || default_message(_('Could not associate the %{resource_name}'))
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
def self.success_message(msg = nil)
|
|
537
|
+
super(msg) || default_message(_('The %{resource_name} has been associated'))
|
|
538
|
+
end
|
|
539
|
+
|
|
524
540
|
def get_new_ids
|
|
525
541
|
ids = get_current_ids.map(&:to_s)
|
|
526
542
|
required_id = get_associated_identifier.to_s
|
|
@@ -551,7 +567,12 @@ module HammerCLIForeman
|
|
|
551
567
|
ids
|
|
552
568
|
end
|
|
553
569
|
|
|
554
|
-
|
|
555
|
-
|
|
570
|
+
def self.failure_message(msg = nil)
|
|
571
|
+
super(msg) || default_message(_('Could not disassociate the %{resource_name}'))
|
|
572
|
+
end
|
|
556
573
|
|
|
574
|
+
def self.success_message(msg = nil)
|
|
575
|
+
super(msg) || default_message(_('The %{resource_name} has been disassociated'))
|
|
576
|
+
end
|
|
577
|
+
end
|
|
557
578
|
end
|
|
@@ -10,6 +10,7 @@ module HammerCLIForeman
|
|
|
10
10
|
[RestClient::InternalServerError, :handle_internal_error],
|
|
11
11
|
[RestClient::Forbidden, :handle_forbidden],
|
|
12
12
|
[RestClient::UnprocessableEntity, :handle_unprocessable_entity],
|
|
13
|
+
[RestClient::MovedPermanently, :handle_moved_permanently],
|
|
13
14
|
[ArgumentError, :handle_argument_error],
|
|
14
15
|
]
|
|
15
16
|
end
|
|
@@ -24,6 +25,18 @@ module HammerCLIForeman
|
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
def handle_moved_permanently(e)
|
|
29
|
+
error = [_("Redirection of API call detected.")]
|
|
30
|
+
https_message = _("It seems hammer is configured to use HTTP and the server prefers HTTPS.")
|
|
31
|
+
error << https_message if strip_protocol(e.response.headers[:location]) == strip_protocol(e.response.request.url)
|
|
32
|
+
error << _("Update your server url configuration")
|
|
33
|
+
error << _("you can set 'follow_redirects' to one of :default or :always to enable redirects following")
|
|
34
|
+
print_error error.join("\n")
|
|
35
|
+
log_full_error e
|
|
36
|
+
HammerCLI::EX_CONFIG
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
|
|
27
40
|
def handle_internal_error(e)
|
|
28
41
|
handle_foreman_error(e)
|
|
29
42
|
HammerCLI::EX_SOFTWARE
|
|
@@ -79,5 +92,10 @@ module HammerCLIForeman
|
|
|
79
92
|
HammerCLI::EX_CONFIG
|
|
80
93
|
end
|
|
81
94
|
|
|
95
|
+
private
|
|
96
|
+
|
|
97
|
+
def strip_protocol(url)
|
|
98
|
+
url.gsub(%r'^http(s)?://','').gsub(%r'//', '/')
|
|
99
|
+
end
|
|
82
100
|
end
|
|
83
101
|
end
|
|
@@ -368,12 +368,8 @@ module HammerCLIForeman
|
|
|
368
368
|
super
|
|
369
369
|
unless validator.any(:option_hostgroup_id, :option_hostgroup_name).exist?
|
|
370
370
|
if option_managed
|
|
371
|
-
validator.all(:
|
|
372
|
-
:
|
|
373
|
-
:option_ptable_id).required
|
|
374
|
-
else
|
|
375
|
-
# unmanaged host only requires environment
|
|
376
|
-
validator.option(:option_environment_id).required
|
|
371
|
+
validator.all(:option_architecture_id, :option_domain_id,
|
|
372
|
+
:option_operatingsystem_id, :option_ptable_id).required
|
|
377
373
|
end
|
|
378
374
|
end
|
|
379
375
|
end
|
|
@@ -518,6 +514,15 @@ module HammerCLIForeman
|
|
|
518
514
|
end
|
|
519
515
|
end
|
|
520
516
|
|
|
517
|
+
class RebuildConfigCommand < HammerCLIForeman::SingleResourceCommand
|
|
518
|
+
action :rebuild_config
|
|
519
|
+
command_name "rebuild-config"
|
|
520
|
+
desc _('Rebuild orchestration related configurations for host')
|
|
521
|
+
success_message _('Configuration successfully rebuilt.')
|
|
522
|
+
|
|
523
|
+
build_options
|
|
524
|
+
end
|
|
525
|
+
|
|
521
526
|
autoload_subcommands
|
|
522
527
|
|
|
523
528
|
subcommand 'interface', HammerCLIForeman::Interface.desc, HammerCLIForeman::Interface
|
|
@@ -119,7 +119,7 @@ module HammerCLIForeman
|
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def puppetclass_ids(options)
|
|
122
|
-
options[HammerCLI.option_accessor_name("ids")] ||
|
|
122
|
+
options[HammerCLI.option_accessor_name("ids")] || find_puppetclasses(options).collect { |c| c['id'] }
|
|
123
123
|
end
|
|
124
124
|
|
|
125
125
|
protected
|
|
@@ -154,6 +154,14 @@ module HammerCLIForeman
|
|
|
154
154
|
results
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
+
def find_puppetclasses(options)
|
|
158
|
+
resource_name = :puppetclasses
|
|
159
|
+
resource = @api.resource(resource_name)
|
|
160
|
+
results = resolved_call(resource_name, :index, options).first.values.flatten
|
|
161
|
+
raise ResolverError.new(_("one of %s not found") % resource.name, resource) if results.count < expected_record_count(options, resource)
|
|
162
|
+
results
|
|
163
|
+
end
|
|
164
|
+
|
|
157
165
|
def find_resource(resource_name, options)
|
|
158
166
|
results = find_resource_raw(resource_name, options)
|
|
159
167
|
resource = @api.resource(resource_name)
|
|
@@ -209,7 +217,7 @@ module HammerCLIForeman
|
|
|
209
217
|
else
|
|
210
218
|
create_search_options(options, resource)
|
|
211
219
|
end
|
|
212
|
-
raise
|
|
220
|
+
raise MissingSearchOptions.new(_("Missing options to search %s") % resource.singular_name, resource) if search_options.empty?
|
|
213
221
|
search_options
|
|
214
222
|
end
|
|
215
223
|
|