Project

General

Profile

Actions

Bug #9870

closed

[hammer] Auto-provisioning a host, when no rule is defined, should raise proper error

Added by Ori Rabin about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Discovery plugin
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1202251
Description of problem:
In hammer, we have auto-provision cmd under discovery.

---
]# hammer --username admin --password changeme discovery auto-provision --help

Usage:
hammer discovery auto-provision [OPTIONS]

Options:
--id ID
--name NAME Name to search by
h, --help print help
-

I tried auto-provision via hammer and neither discovery rule was defined nor any rule was defined. But hammer says 'host created'

Its seems to be misleading. Hammer should throw an error like:

no discovery rule match with discovered host

here is the output:
----

  1. hammer --username admin --password changeme discovery auto-provision --name mac5254003ea9d9

Host created


production.log:

2015-03-16 08:38:18 [I] Processing by Api::V2::DiscoveredHostsController#auto_provision as JSON
2015-03-16 08:38:18 [I] Parameters: {"apiv"=>"v2", "id"=>"7", "discovered_host"=>{}}
2015-03-16 08:38:18 [I] Authorized user admin(Admin User)
2015-03-16 08:38:18 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-2.0.0.6/app/views/api/v2/discovered_hosts/auto_provision.json.rabl (9.5ms)
2015-03-16 08:38:18 [I] Completed 200 OK in 49ms (Views: 9.2ms | ActiveRecord: 16.8ms)

Version-Release number of selected component (if applicable):
sat6.1 beta snap6 compose2 (Satellite-6.1.0-RHEL-6-20150311.1).

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:
on executing auto-provision via hammer, hammer throws "host created" and nothing happens.. It looks misleading..

Expected results:
auto-provisioning via hammer should throw proper error when no discovery rule defined for discovered host

Hammer should throw error like: no matching rule found for discovered host?

Additional info:

Actions #1

Updated by Ori Rabin about 9 years ago

  • Project changed from Foreman to Discovery
  • Category set to Discovery plugin
  • Status changed from New to Assigned
Actions #2

Updated by The Foreman Bot about 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/171 added
  • Pull request deleted ()
Actions #3

Updated by Ori Rabin about 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF