Merge lp:~smoser/nova/lp812553 into lp:~hudson-openstack/nova/trunk

Proposed by Scott Moser
Status: Merged
Approved by: Devin Carlen
Approved revision: 1285
Merged at revision: 1288
Proposed branch: lp:~smoser/nova/lp812553
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 17 lines (+3/-4)
1 file modified
nova/virt/libvirt/connection.py (+3/-4)
To merge this branch: bzr merge lp:~smoser/nova/lp812553
Reviewer Review Type Date Requested Status
Mandell (community) community Approve
Devin Carlen (community) Approve
Jason Kölker (community) Needs Fixing
Vish Ishaya (community) Approve
Review via email: mp+68423@code.launchpad.net

Commit message

correct broken logic for lxc and uml to avoid adding vnc arguments (LP: #812553)

This fixes the logic, so that lxc and uml will not get vnc arguments added to
their libvirt xml. It also seems more readable to me.

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm

review: Approve
Revision history for this message
Jason Kölker (jason-koelker) wrote :

Syntactic nitpick, the block in the if statement is now double indented. Logic is sound.

review: Needs Fixing
lp:~smoser/nova/lp812553 updated
1285. By Scott Moser

correct indentation

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

lgtm

review: Approve
Revision history for this message
Mandell (mdegerne) wrote :

Gotta love that negative logic.

Nice fix.

review: Approve (community)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/libvirt/connection.py'
2--- nova/virt/libvirt/connection.py 2011-07-13 18:19:32 +0000
3+++ nova/virt/libvirt/connection.py 2011-07-20 16:26:33 +0000
4@@ -1014,10 +1014,9 @@
5 'ebs_root': ebs_root,
6 'volumes': block_device_mapping}
7
8- if FLAGS.vnc_enabled:
9- if FLAGS.libvirt_type != 'lxc' or FLAGS.libvirt_type != 'uml':
10- xml_info['vncserver_host'] = FLAGS.vncserver_host
11- xml_info['vnc_keymap'] = FLAGS.vnc_keymap
12+ if FLAGS.vnc_enabled and FLAGS.libvirt_type not in ('lxc', 'uml'):
13+ xml_info['vncserver_host'] = FLAGS.vncserver_host
14+ xml_info['vnc_keymap'] = FLAGS.vnc_keymap
15 if not rescue:
16 if instance['kernel_id']:
17 xml_info['kernel'] = xml_info['basepath'] + "/kernel"