summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Burgess <cfb@metacloud.com>2013-01-24 02:10:18 +0000
committerChet Burgess <cfb@metacloud.com>2013-01-24 23:46:37 +0000
commitd94e693bc49d5ce717ea62f02741dccc435af3f3 (patch)
tree87385ed677e5d51a8f3c868b649aa47ef1c0d5f8
parentf9012e39ee5582192db9289d34df3adaddda2ad1 (diff)
downloadnova-d94e693bc49d5ce717ea62f02741dccc435af3f3.tar.gz
nova-d94e693bc49d5ce717ea62f02741dccc435af3f3.tar.xz
nova-d94e693bc49d5ce717ea62f02741dccc435af3f3.zip
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
-rwxr-xr-xbin/nova-dhcpbridge5
1 files changed, 5 insertions, 0 deletions
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'])