Code review comment for lp:~allenap/maas/move-dhcp-helper-to-lib

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Blake is correct; the path is hard-coded in some of the leases, so that MAAS knows what binary to call when the lease expires, such as:

lease 172.16.100.150 {
  starts 1 2017/03/27 21:42:51;
  ends 1 2017/03/27 21:44:51;
  tstp 1 2017/03/27 21:44:51;
  cltt 1 2017/03/27 21:42:51;
  binding state free;
  hardware ethernet 0c:c4:7a:c0:31:fa;
  set vendor-class-identifier = "Linux ipconfig";
  client-hostname "skylake";
  on expiry {
    set clhw =
       binary-to-ascii (16, 8, ":",
                        substring (hardware, 1, 6)) ;
    set clip =
       binary-to-ascii (10, 8, ".", leased-address) ;
    execute ("/usr/sbin/maas-dhcp-helper", "notify", "--action", "expiry",
        "--mac", clhw, "--ip-family", "ipv4", "--ip", clip);
  }
  on release {
    set clhw =
       binary-to-ascii (16, 8, ":",
                        substring (hardware, 1, 6)) ;
    set clip =
       binary-to-ascii (10, 8, ".", leased-address) ;
    execute ("/usr/sbin/maas-dhcp-helper", "notify", "--action", "release",
        "--mac", clhw, "--ip-family", "ipv4", "--ip", clip);
  }
}

So I don't think we can move this around.

review: Disapprove

« Back to merge proposal