Bug 1202251
Summary: | [hammer] Auto-provisioning a host, when no rule is defined, should raise proper error | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sachin Ghai <sghai> |
Component: | Hammer | Assignee: | orabin |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Sachin Ghai <sghai> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.1.0 | CC: | bkearney, lzap, orabin |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/9870 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-08-12 16:02:24 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1193977 |
Description
Sachin Ghai
2015-03-16 08:39:36 UTC
Please note that auto-provisioning via hammer works if user define a matching discovery rule. I think we should throw an error when no rule is defined or no matching rule available for discovered host Valid bug, Ori can you squeeze this in 0.0.2? Created redmine issue http://projects.theforeman.org/issues/9870 from this bug Moving to POST since upstream bug http://projects.theforeman.org/issues/9870 has been closed ------------- Ori Rabin Applied in changeset commit:foreman_discovery|5188cf125376dd783653a82040e24a4b3e294cb5. Reported issue is still reproducible with: sat6.1 GA snap1 compose 2 (Satellite-6.1.0-RHEL-7-20150424.0) [root@cloud-qe-9 ~]# hammer --username admin --password changeme discovery list ---|-----------------|-------------------|---------------------|------|--------|------------|------------|---------|-------------------- ID | NAME | MAC | LAST REPORT | CPUS | MEMORY | DISK COUNT | DISKS SIZE | SUBNET | LAST REPORT ---|-----------------|-------------------|---------------------|------|--------|------------|------------|---------|-------------------- 3 | mac525400c6b527 | 52:54:00:c6:b5:27 | 2015/04/27 12:24:38 | 1 | 995 | 1 | 8192 | libvirt | 2015/04/27 12:24:38 ---|-----------------|-------------------|---------------------|------|--------|------------|------------|---------|-------------------- [root@cloud-qe-9 ~]# hammer --username admin --password changeme discovery auto-provision --name mac525400c6b527 Host created [root@cloud-qe-9 ~]# The compose is using a version of discovery prior to Bryan's merge. The package needs to be rebuilt with the changes and then tested. Moving to post until there is a new package. Issue is still reproducible with sat6.1 GA Snap2 (Satellite-6.1.0-RHEL-7-20150429.2) when no rule is defined, hammer still throwing 'Host created'. # hammer --username admin --password changeme discovery auto-provision --name mac525400c75a5e Host created upstream bug is closed verified with sat6.1 GA snap7. now I get this error on auto-provisioning a discovered host when no rule is defined: ~]# hammer --username admin --password changeme discovery auto-provision --name mac52540038a98e Could not create the host 2015-06-05 07:16:16 [I] Processing by Api::V2::DiscoveredHostsController#auto_provision as JSON 2015-06-05 07:16:16 [I] Parameters: {"apiv"=>"v2", "id"=>"3", "discovered_host"=>{}} 2015-06-05 07:16:16 [I] Authorized user admin(Admin User) 2015-06-05 07:16:16 [I] Rendered api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout (0.3ms) 2015-06-05 07:16:16 [I] Completed 422 Unprocessable Entity in 29ms (Views: 0.9ms | ActiveRecord: 14.2ms) "Could not create the host" is very generalized error message. Error message should be friendly enough for user to know what's going wrong. I think as per bug description, if we can change the error like below would be more appropriate. "No matching rule found for discovered host" Thanks Orabin. Assigning back. Moving to POST since this was merged upstream Delivered with Snap12. Verified with sat6.1.1 GA snap12. Now I'm getting proper error message. Thanks Orabin for fixing it. [root@cloud-qe-17 ~]# hammer --username admin --password changeme discovery auto-provision --name mac52540063d7a2 Could not create the host: No rule found for host mac52540063d7a2 [root@cloud-qe-17 ~]# This bug was fixed in Satellite 6.1.1 which was delivered on 12 August, 2015. |