theforeman/foreman — pull request #1430 by GregSutcliffe (2014-05-09 09:30:25+00:00)
Title: Fixes #5637 - Don't mark conflicts for confirming ad-hoc leases

You'll need to reproduce this by adding an active lease without a hostname (ie for a machine that booted up outside of Foreman's control) such that the proxy replies like this:

```
curl -k https://localhost:8443/dhcp/192.168.123.0/52:54:00:33:b5:df
{"starts":"2014-05-09 09:12:22 UTC","ends":"2014-05-09 09:22:22 UTC","state":"active","mac":"52:54:00:33:b5:df","subnet":"192.168.123.0/255.255.255.0","ip":"192.168.123.52"}
```

You can do that with a lease like:

```
lease 192.168.123.52 {
starts 5 2014/05/09 09:24:23;
ends 5 2014/05/09 09:34:23;
cltt 5 2014/05/09 09:24:23;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 52:54:00:33:b5:df;
}
```

Then try to provision a host using that exact mac/ip/network (so the only difference is the missing hostname). The current core code should then crash with a Net::LeaseConflict. This code should provision just fine, but continue to offer conflict resolution when other data is mismatched.