[pve-devel] [PATCH manager 2/4] fix lxc hostname editing

Emmanuel Kasper e.kasper at proxmox.com
Wed Jul 6 13:02:11 CEST 2016


On 07/06/2016 12:39 PM, Wolfgang Bumiller wrote:
> On Wed, Jul 06, 2016 at 12:05:44PM +0200, Emmanuel Kasper wrote:
>> Hi
>> I put the comments inline
>>
>>> also instead of simply setting the emptyText to the name on
>>> tab creation, we load the window, which then gets the actual value
>> acked
>>
>>
>>> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>>> ---
>>>  www/manager6/lxc/DNS.js | 9 +++++----
>>>  1 file changed, 5 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
>>> index eaf1719..6fa8ef2 100644
>>> --- a/www/manager6/lxc/DNS.js
>>> +++ b/www/manager6/lxc/DNS.js
>>> @@ -156,7 +156,7 @@ Ext.define('PVE.lxc.DNS', {
>>>  	var rows = {
>>>  	    hostname: {
>>>  		required: true,
>>> -		defaultValue: me.pveSelNode.data.name,
>>> +		defaultValue: 'localhost',
>>>  		header: gettext('Hostname'),
>>>  		editor: caps.vms['VM.Config.Network'] ? {
>>>  		    xtype: 'pveWindowEdit',
>>> @@ -167,8 +167,8 @@ Ext.define('PVE.lxc.DNS', {
>>>  			vtype: 'DnsName',
>>>  			value: '',
>>>  			fieldLabel: gettext('Hostname'),
>>> -			allowBlank: true,
>>> -			emptyText: me.pveSelNode.data.name
>>> +			allowBlank: false,
>>> +			emptyText: 'localhost'
>>
>> not sure if localhost itself is not a particulary good placeholder, as
>> it is not unique, and will create a duplicate entry in the /etc/hosts
>> container
> 
> The issue was that on the backend side if no hostname is set we do use
> 'localhost' rather than 'ct$vmid' as the gui suggested.

it seems the behaviour on the backend differs depending on which LXC
template you use because using Centos6 and Debian8 templates, I do get a
hostname of the form "CT$vmid".

could it be that some other templates override the base behaviour here ?




More information about the pve-devel mailing list