~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to bin/nova-dhcpbridge

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from nova import db
40
40
from nova import flags
41
41
from nova import log as logging
 
42
from nova.network import linux_net
 
43
from nova.openstack.common import importutils
42
44
from nova import rpc
43
45
from nova import utils
44
 
from nova.network import linux_net
45
46
 
46
47
FLAGS = flags.FLAGS
47
48
 
52
53
    """Set the IP that was assigned by the DHCP server."""
53
54
    if FLAGS.fake_rabbit:
54
55
        LOG.debug(_("leasing ip"))
55
 
        network_manager = utils.import_object(FLAGS.network_manager)
 
56
        network_manager = importutils.import_object(FLAGS.network_manager)
56
57
        network_manager.lease_fixed_ip(context.get_admin_context(),
57
58
                                       ip_address)
58
59
    else:
74
75
    """Called when a lease expires."""
75
76
    if FLAGS.fake_rabbit:
76
77
        LOG.debug(_("releasing ip"))
77
 
        network_manager = utils.import_object(FLAGS.network_manager)
 
78
        network_manager = importutils.import_object(FLAGS.network_manager)
78
79
        network_manager.release_fixed_ip(context.get_admin_context(),
79
80
                                         ip_address)
80
81
    else:
88
89
    """Get the list of hosts for a network."""
89
90
    ctxt = context.get_admin_context()
90
91
    network_ref = db.network_get(ctxt, network_id)
91
 
    network_manager = utils.import_object(FLAGS.network_manager)
 
92
    network_manager = importutils.import_object(FLAGS.network_manager)
92
93
    return network_manager.get_dhcp_leases(ctxt, network_ref)
93
94
 
94
95
 
95
96
def main():
96
97
    """Parse environment and arguments and call the approproate action."""
97
98
    flagfile = os.environ.get('FLAGFILE', FLAGS.dhcpbridge_flagfile)
98
 
    utils.default_flagfile(flagfile)
 
99
    utils.default_cfgfile(flagfile)
99
100
    argv = FLAGS(sys.argv)
100
101
    logging.setup()
101
102
 
 
103
    rpc.register_opts(FLAGS)
 
104
 
102
105
    if int(os.environ.get('TESTING', '0')):
103
106
        from nova.tests import fake_flags
104
107