diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2010-07-19 20:07:39 +0000 |
|---|---|---|
| committer | Tarmac <> | 2010-07-19 20:07:39 +0000 |
| commit | a232ba0fda12a98e9da4345a6911a86b68f91826 (patch) | |
| tree | 3e45898c6f4a58fd17759ad29d8117294d4914ad /bin | |
| parent | d52925f1f3293a4ad1692bd1aab846c713f7c3de (diff) | |
| parent | 19a8556917ffebf9f85e68df4a841e1ea97124d2 (diff) | |
| download | nova-a232ba0fda12a98e9da4345a6911a86b68f91826.tar.gz nova-a232ba0fda12a98e9da4345a6911a86b68f91826.tar.xz nova-a232ba0fda12a98e9da4345a6911a86b68f91826.zip | |
Fixes to dhcp lease code to use a flagfile
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-dhcpbridge (renamed from bin/dhcpleasor.py) | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/bin/dhcpleasor.py b/bin/nova-dhcpbridge index 07ff325f1..d15924e57 100755 --- a/bin/dhcpleasor.py +++ b/bin/nova-dhcpbridge @@ -18,23 +18,27 @@ # under the License. """ -dhcpleasor.py +nova-dhcpbridge Handle lease database updates from DHCP servers. """ -import sys -import os import logging +import os +import sys + +#TODO(joshua): there is concern that the user dnsmasq runs under will not +# have nova in the path. This should be verified and if it is +# not true the ugly line below can be removed sys.path.append(os.path.abspath(os.path.join(__file__, "../../"))) -logging.debug(sys.path) -import getopt -from os import environ -from nova import rpc from nova import flags +from nova import rpc +from nova import utils from nova.compute import linux_net from nova.compute import network + + FLAGS = flags.FLAGS @@ -63,11 +67,12 @@ def init_leases(interface): return res -def main(argv=None): - if argv is None: - argv = sys.argv - interface = environ.get('DNSMASQ_INTERFACE', 'br0') - if int(environ.get('TESTING', '0')): +def main(): + flagfile = os.environ.get('FLAGFILE', FLAGS.dhcpbridge_flagfile) + utils.default_flagfile(flagfile) + argv = FLAGS(sys.argv) + interface = os.environ.get('DNSMASQ_INTERFACE', 'br0') + if int(os.environ.get('TESTING', '0')): FLAGS.fake_rabbit = True FLAGS.redis_db = 8 FLAGS.network_size = 32 |
