Only add VNC password and listen port if present

Previous to this commit, the VNC password and listen address was defined
in the creation of a libvirt domain, whether a listen address or
password was specified or not.  This commit, only adds the parameters if
they're specified, and not empty
This commit is contained in:
Carl Caum 2012-08-03 12:37:39 -07:00
parent 530122de30
commit 831be2d4f7
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='<%= display[:type] %>' port='<%= display[:port] %>' autoport='yes' listen='<%= display[:listen] %>' passwd='<%=display[:password] %>'/>
<graphics type='<%= display[:type] %>' port='<%= display[:port] %>' autoport='yes' <% if display[:listen] and !(display[:listen].empty?) %> listen='<%= display[:listen] %>'<% end %> <% if display[:password] and !(display[:password].empty?) %>passwd='<%=display[:password] %>'<% end %> />
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>