Description of problem: Cannot create a host via hammer. If you try to create a host without an interface, hammer throws following error 'Error: At least one interface must be set as primary', and if you try to create a host with interface specified - it throws 'Error: ApipieBindings::InvalidArgumentTypesError: host[interfaces_attributes][0] - Hash was expected' Version-Release number of selected component (if applicable): Sat6.2 Snap 4 How reproducible: Always Steps to Reproduce: 1. Try to create a host with valid data, e.g. hammer host create --medium-id="106" --root-pass="test" --mac="#mac#" --organization-id="212" --location-id="211" --architecture-id="104" --operatingsystem-id="102" --name="new_host" --environment-id="99" --domain-id="99" --puppet-proxy-id="1" --partition-table-id="180" --interface="primary=true,provision=true,identifier=enp4s0f0,type=interface,mac=#mac#,ip=#ip#" 2. 3. Actual results: Following error message is shown: Could not create the host: Error: ApipieBindings::InvalidArgumentTypesError: host[interfaces_attributes][0] - Hash was expected Expected results: Host was successfully created Additional info:
This bug combines two issues - first is that primary interface must be specified which was fixed (http://projects.theforeman.org/issues/13927). Second is the attributes error which I linked and is also fixed (http://projects.theforeman.org/issues/13966)
I believe this works now? # hammer host create --medium-id="9" --root-pass="changeme" --mac="2e-ba-bb-97-45-d6" --organization-id="1" --location-id="1" --architecture-id="1" --operatingsystem-id="1" --name="new_host" --environment-id="1" --domain-id="1" --puppet-proxy-id="1" --partition-table-id="1" --interface="primary=true,provision=true,identifier=enp4s0f0,type=interface,mac=2e-ba-bb-97-45-d6,ip=192.168.1.200" --name "frobble" [Foreman] Password for admin: Host created
Above ^ was executed against SNAP6. If it is not verified correctly, please reopen, but reading the initial report, I believe this suffices.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1501