catch-22 VTY error

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Tue May 9 10:46:38 UTC 2017


On Tue, May 09, 2017 at 07:06:27AM +0200, Harald Welte wrote:
> Hi Neels,
> 
> On Tue, May 09, 2017 at 12:15:12AM +0200, Neels Hofmeyr wrote:
> > About 2: we tend to indent our VTY config files, but in fact the indentation
> > has no effect whatsoever, it is just eye candy (very useful eye candy).
> 
> Maybe we should change that part, rather than renaming commands for no
> good reason?  We could use the indent level to generate 'virtual node
> exit' commands...

And call it "vtython" from python :)

I indeed would prefer that from the implicit exiting. Hoping that most
users would anyway have properly indented config files...

On the telnet vty, we can so far also issue commands that belong to the
parent and end up on the parent level implicitly, which we would also stop
with this change; I think that'd be a good thing.

The code would be slightly non-trivial, simply counting the number of
spaces leading each line, and issue an exit for every decrease is not
enough: we need to count the number of de-indentings to exit multiple
times e.g. at the end of net/bts/trx. I guess we should count tabs as
single indents, but make sure that a config file has only tabs or only
spaces, not a mixture? count tabs as eight? disallow tabs altogether?
Otherwise we could look at how python solves that and maybe copy their
code over to C... which would probably be quite complex.

~N

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20170509/0797cc77/attachment.bin>


More information about the OpenBSC mailing list