inex/IXP-Manager

Virtual Interface Name: spaces at the end of the string will be trim

Closed this issue · 4 comments

VERSION

define( 'APPLICATION_VERSION', '4.9.2' );
define( 'APPLICATION_VERDATE', '201901210000' );

DEVICES
DELL Force10 S4810
DELL 4048-ON
Version 9.10

SUMMARY

The webform trim the value of the name field after submit the form and save the name of virtual interface "Port-channel " without a space after the string. The bundle name will then be "Port-Channel2" and not "Port-Channel 2". Our edge devices shows the portchannel names "Port-channel 1" , "Port-channel 2" and not "Port-channel1" , "Port-channel 2".
Then the update-l2database.pl script will not work properly and will not be able to map macadresses to the customer. Thus the peer to peer graphs do not work either.

I found out that laravel trim all requests by default.
https://laravel.com/docs/5.5/validation

A Note On Optional Fields
By default, Laravel includes the TrimStrings and ConvertEmptyStringsToNull middleware in your application's global middleware stack. These middleware are listed in the stack by the App\Http\Kernel class.

Hi @icebreak24,

I found out that laravel trim all requests by default.

Yes, and this is something we rely on.

In the short term, do you think you can edit your database directly and add a space after this and letting me know if that works?

Allowing white space isn't an intuitive solution I think. What might work is if we allow the use of double quotes such as "Port-Channel " (which would be stripped) and document that in the Help text as a possible option in this case.

I'll wait to hear back if a manual edit works first.

Hi @barryo ,

In the short term, do you think you can edit your database directly and add a space after this and letting me know if that works?

if we change it manually in the database and it works. We test it before i write the issue.

Allowing white space isn't an intuitive solution I think. What might work is if we allow the use of double quotes such as "Port-Channel " (which would be stripped) and document that in the Help text as a possible option in this case.

Yes, that could work.

@barryo could you update the help text for that input please

@yannrobin - helptext:

Currently this is:

'Ordinarily this is left blank. In the case of LAGs with provisioning systems, this is used to indicate the '
                            . 'interface base name for LAGs. E.g. on a Cisco, this would be <em>Port-Channel</em>.'

Replace with:

'Ordinarily this is left blank. In the case of LAGs with provisioning systems, this is used to indicate the '
    . 'interface base name for LAGs. E.g. on a Cisco, this would be <code>Port-Channel</code>.<br><br>'
    . 'Some systems require trailing white space after the name. For this, use double-quotes which will '
    . 'be removed automatically. E.g. for a Force10 device, enter: <code>"Port-channel "</code>.'