From d94e693bc49d5ce717ea62f02741dccc435af3f3 Mon Sep 17 00:00:00 2001 From: Chet Burgess Date: Thu, 24 Jan 2013 02:10:18 +0000 Subject: Support optional 4 arg for nova-dhcpbridge dnsmasq will call the add, old, and del actions with an optional 4 argument of hostname if the hostname is known. Since we populate the hostname in the DHCP host file its always passed to us. Add an optional 4 argument for hostname for the add, old, and del actions. Change-Id: I1a6c095324be2424d6c1d469877b254f88fba4aa Fixes: bug #1103783 --- bin/nova-dhcpbridge | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/nova-dhcpbridge b/bin/nova-dhcpbridge index ee7bf2da9..0438ee6ff 100755 --- a/bin/nova-dhcpbridge +++ b/bin/nova-dhcpbridge @@ -96,10 +96,15 @@ def init_leases(network_id): def add_action_parsers(subparsers): parser = subparsers.add_parser('init') + # NOTE(cfb): dnsmasq always passes mac, and ip. hostname + # is passed if known. We don't care about + # hostname, but argparse will complain if we + # do not accept it. for action in ['add', 'del', 'old']: parser = subparsers.add_parser(action) parser.add_argument('mac') parser.add_argument('ip') + parser.add_argument('hostname', nargs='?', default='') parser.set_defaults(func=globals()[action + '_lease']) -- cgit