[yast-devel] [PATCH] Fix setting the IP address and PREFIXLEN via YaPI
Hey everyone :) I noticed that the ipaddr wasn't decomposed into IP and prefix in writeInterfaces so the IPADDR field contained both the IP and the prefix and the PREFIXLEN was left empty. This seems to cause little problems in practice since most of the time both variables are concatenated again, but if you set the IP address using YaPI and read it out again (also using YaPI) you ended up with a string containing an extra trailing /. I think this is why the yast web client code contains lots of .delete("/") in network_controller.rb. The attached patch fixes this problem. Cheers, Justus -- Justus Winter winter@pre-sense.de PRESENSE Technologies GmbH Sachsenstr. 5, D-20097 HH USt-IdNr.: DE263765024 Geschäftsführer/Managing Directors AG Hamburg, HRB 107844 Till Dörges Jürgen Sander Axel Theilmann
On Mon, Jul 25, 2011 at 05:27:03PM +0200, Justus Winter wrote:
Hey everyone :)
I noticed that the ipaddr wasn't decomposed into IP and prefix in writeInterfaces so the IPADDR field contained both the IP and the prefix and the PREFIXLEN was left empty.
This seems to cause little problems in practice since most of the time both variables are concatenated again, but if you set the IP address using YaPI and read it out again (also using YaPI) you ended up with a string containing an extra trailing /. I think this is why the yast web client code contains lots of .delete("/") in network_controller.rb.
The attached patch fixes this problem.
Thank you for the patch! Actually, the form that Write uses is a valid one according to ifcfg(5), so we need to fix Read instead. I am writing some more test cases for it too. -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
On Tue, Jul 26, 2011 at 05:58:16PM +0200, Martin Vidner wrote:
On Mon, Jul 25, 2011 at 05:27:03PM +0200, Justus Winter wrote:
Hey everyone :)
I noticed that the ipaddr wasn't decomposed into IP and prefix in writeInterfaces so the IPADDR field contained both the IP and the prefix and the PREFIXLEN was left empty.
This seems to cause little problems in practice since most of the time both variables are concatenated again, but if you set the IP address using YaPI and read it out again (also using YaPI) you ended up with a string containing an extra trailing /. I think this is why the yast web client code contains lots of .delete("/") in network_controller.rb.
The attached patch fixes this problem.
Thank you for the patch!
Actually, the form that Write uses is a valid one according to ifcfg(5), so we need to fix Read instead. I am writing some more test cases for it too.
Hi Justus, I have applied an improved version in http://svn.opensuse.org/viewvc/yast?view=revision&revision=65339 -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
participants (2)
-
Justus Winter
-
Martin Vidner