Merge lp:~berendt/nova/fixing_713434 into lp:~hudson-openstack/nova/trunk

Proposed by Christian Berendt
Status: Merged
Approved by: Devin Carlen
Approved revision: 652
Merged at revision: 650
Proposed branch: lp:~berendt/nova/fixing_713434
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 44 lines (+7/-1)
2 files modified
Authors (+1/-0)
nova/network/linux_net.py (+6/-1)
To merge this branch: bzr merge lp:~berendt/nova/fixing_713434
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve
Soren Hansen (community) Approve
Review via email: mp+48770@code.launchpad.net

Description of the change

added new parameter --dhcp_domain to set the used domain by dnsmasq in /etc/nova/nova.conf

To post a comment you must log in.
Revision history for this message
Soren Hansen (soren) wrote :

From pep8:

nova/network/linux_net.py:321:1: W191 indentation contains tabs
       FLAGS.dhcp_domain,
^
    For new projects, spaces-only are strongly recommended over tabs. Most
    editors have features that make this easy to do.

    Okay: if True:\n return
    W191: if True:\n\treturn
nova/network/linux_net.py:321:1: E101 indentation contains mixed spaces and tabs
       FLAGS.dhcp_domain,
^
    Never mix tabs and spaces.

    The most popular way of indenting Python is with spaces only. The
    second-most popular way is with tabs only. Code indented with a mixture
    of tabs and spaces should be converted to using spaces exclusively. When
    invoking the Python command line interpreter with the -t option, it issues
    warnings about code that illegally mixes tabs and spaces. When using -tt
    these warnings become errors. These options are highly recommended!

    Okay: if a == 0:\n a = 1\n b = 1
    E101: if a == 0:\n a = 1\n\tb = 1
nova/network/linux_net.py:366:1: W191 indentation contains tabs
    ' --domain=%s' % FLAGS.dhcp_domain,
^
    For new projects, spaces-only are strongly recommended over tabs. Most
    editors have features that make this easy to do.

    Okay: if True:\n return
    W191: if True:\n\treturn
nova/network/linux_net.py:366:1: E101 indentation contains mixed spaces and tabs
    ' --domain=%s' % FLAGS.dhcp_domain,
^
    Never mix tabs and spaces.

    The most popular way of indenting Python is with spaces only. The
    second-most popular way is with tabs only. Code indented with a mixture
    of tabs and spaces should be converted to using spaces exclusively. When
    invoking the Python command line interpreter with the -t option, it issues
    warnings about code that illegally mixes tabs and spaces. When using -tt
    these warnings become errors. These options are highly recommended!

    Okay: if a == 0:\n a = 1\n b = 1
    E101: if a == 0:\n a = 1\n\tb = 1

review: Needs Fixing
lp:~berendt/nova/fixing_713434 updated
652. By Christian Berendt

fixed format according to PEP8

Revision history for this message
Soren Hansen (soren) wrote :

lgtm, thanks!

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Authors'
2--- Authors 2011-02-04 10:48:45 +0000
3+++ Authors 2011-02-07 14:22:16 +0000
4@@ -6,6 +6,7 @@
5 Chiradeep Vittal <chiradeep@cloud.com>
6 Chmouel Boudjnah <chmouel@chmouel.com>
7 Chris Behrens <cbehrens@codestud.com>
8+Christian Berendt <berendt@b1-systems.de>
9 Cory Wright <corywright@gmail.com>
10 David Pravec <David.Pravec@danix.org>
11 Dan Prince <dan.prince@rackspace.com>
12
13=== modified file 'nova/network/linux_net.py'
14--- nova/network/linux_net.py 2011-01-26 12:10:51 +0000
15+++ nova/network/linux_net.py 2011-02-07 14:22:16 +0000
16@@ -37,6 +37,9 @@
17 flags.DEFINE_string('dhcpbridge_flagfile',
18 '/etc/nova/nova-dhcpbridge.conf',
19 'location of flagfile for dhcpbridge')
20+flags.DEFINE_string('dhcp_domain',
21+ 'novalocal',
22+ 'domain to use for building the hostnames')
23
24 flags.DEFINE_string('networks_path', '$state_path/networks',
25 'Location to keep network config files')
26@@ -313,8 +316,9 @@
27 def _host_dhcp(fixed_ip_ref):
28 """Return a host string for an address"""
29 instance_ref = fixed_ip_ref['instance']
30- return "%s,%s.novalocal,%s" % (instance_ref['mac_address'],
31+ return "%s,%s.%s,%s" % (instance_ref['mac_address'],
32 instance_ref['hostname'],
33+ FLAGS.dhcp_domain,
34 fixed_ip_ref['address'])
35
36
37@@ -359,6 +363,7 @@
38 ' --strict-order',
39 ' --bind-interfaces',
40 ' --conf-file=',
41+ ' --domain=%s' % FLAGS.dhcp_domain,
42 ' --pid-file=%s' % _dhcp_file(net['bridge'], 'pid'),
43 ' --listen-address=%s' % net['gateway'],
44 ' --except-interface=lo',