Now i did a little change to the code

only for testing

attached the file....

it works ok with

pvesh set nodes/localhost/network/vmbr0 -network_name "mylan"

this is the result

iface vmbr0 inet manual
        address  192.168.1.55
        netmask  255.255.255.0
        gateway  192.168.1.253
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        network_name mylan

the additional parameter gives no problem to ifconfig
and to the network scripts

pvesh get nodes/localhost/network/vmbr0

works ok

200 OK
{
   "active" : 1,
   "address" : "192.168.1.55",
   "autostart" : 1,
   "bridge_fd" : "0",
   "bridge_ports" : "eth0",
   "bridge_stp" : "off",
   "exists" : 1,
   "gateway" : "192.168.1.253",
   "method" : "manual",
   "netmask" : "255.255.255.0",
   "network_name" : "mylan",
   "priority" : 4,
   "type" : "bridge"
}

but from the interface (js) i've always the same error when entering
network_name via gui.

Parameter verification failed. (400)

network_name: property is not defined in schema and the schema does not allow additional properties

How can I add this property to the schema used by js?

Tx, Diaolin






---
S’à destacà l’ultima föia dal bósch nét
crodàda l’ei, solàgna, ‘n mèzz ai sàssi
e ‘ntant fis-ciava ‘n zìfol de oseleti
a tegnìr vìo ‘l pensér che vèn matìna
[Diaolin]
diff -r change/perl5/PVE/API2/Network.pm real/perl5/PVE/API2/Network.pm
32,36d31
<     network_name => {
<        description => "Network Name",
<        type => 'string',
< 	optional => 1,
<     },
diff -r change/perl5/PVE/INotify.pm real/perl5/PVE/INotify.pm
737c737
< 		}   elsif ($line =~ m/^\s+((\S+)\s+(.+))$/) {
---
> 		} elsif ($line =~ m/^\s+((\S+)\s+(.+))$/) {
740c740
< 		    if (($id eq 'address') || ($id eq 'netmask') || ($id eq 'broadcast') || ($id eq 'network_name') ) {
---
> 		    if (($id eq 'address') || ($id eq 'netmask') || ($id eq 'broadcast')) {
888,895d887
< 
<     # add network name
<     my $network_name = $d->{network_name} || '';
<     if ($network_name){
< 	$raw .= "\tnetwork_name $network_name\n";
<     }
<     
< 
diff -r change/pve-manager/ext4/pvemanagerlib.js real/pve-manager/ext4/pvemanagerlib.js
8811,8818c8811
< 
< };
< 	    column2.push({
< 		xtype: 'pvetextfield',
< 		deleteEmpty: !me.create,
< 		fieldLabel: gettext('Network Name'),
< 		name: 'network_name'
< 	    });
---
> 	}
9149,9153d9141
< 			},
< 			{
< 			    header: gettext('Network Name'),
< 			    sortable: false,
< 			    dataIndex: 'network_name'
9155d9142
< 
9191c9178
< 	    'netmask', 'gateway', 'network_name'  
---
> 	    'netmask', 'gateway'
_______________________________________________
pve-user mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-user

Reply via email to