more and clearer error/debug messages, allow A-Z and -_. in config filenames#4
more and clearer error/debug messages, allow A-Z and -_. in config filenames#4morgana2313 wants to merge 1 commit intoLINBIT:masterfrom
Conversation
lge
left a comment
There was a problem hiding this comment.
usually, if you think you want to use "config names", you really want to use "groups" (and the default config name) instead.
That said, config names must be valid filenames, AND valid database names in the supported databases, and the way the database names are constructed (from myhostname and cfgname) must not lead to ambiguities.
Relaxing this from [a-zA-Z0-9] to [a-zAZ0-9_.-] looks harmless enough.
The %s -> [%s] is a matter of taste, I guess.
The indentation of the {} in your changed if () {} is slightly broken.
Trailing whitespace cleanup is fine with me ;)
Version bump is likely a good idea anyways... just to show we are still alive :-)
Looks good to me, give me a bit to think about possible "bad" implications of the less restrictive cfgname, there may be some weird side effect somewhere, I seem to remember that there was a reason to be that strict; I just don't recall what it was :-/
Anyways, should be merged soon.
Thank you for taking the time to prepare this pull request.
|
Hello Ige,
Op 3 apr. 2018, om 20:14 heeft Lars Ellenberg ***@***.***> het volgende geschreven:
@lge commented on this pull request.
usually, if you think you want to use "config names", you really want to use "groups" (and the default config name) instead.
That said, config names must be valid filenames, AND valid database names in the supported databases, and the way the database names are constructed (from myhostname and cfgname) must not lead to ambiguities.
Relaxing this from [a-zA-Z0-9] to [a-zAZ0-9_.-] looks harmless enough
Thanks for the tip, I’ll look into that.
If that’s the reason the dots (and the minus sign) might prove to be a problem (with a mysql backend anyway).
The %s -> [%s] is a matter of taste, I guess.
I was trying to figure out the difference between hostname and hostname. (followed by a dot as in a TLD). The dots at the end of sentences were confusing :-)
Kind regards, Jasper
|
|
I'm using csync2 in combination with lsync (to only start it when an inotify happens) in a dynamic environment where the config files are generated by Saltstack. There is a valid case where peers change or might not be resolvable or online (yet). I seems that csync2 doesn't notice new peers until I delete te database. Are there a options where I can tell csync2 to update the hosts in the database and don't abort the sync on a host that is not resolvable or online yet? |
|
I'm using csync2 in combination with lsync (to only start it when an
inotify happens) in a dynamic environment where the config files are
generated by Saltstack. There is a valid case where peers change or
might not be resolvable or online (yet). I seems that csync2 doesn't
notice new peers until I delete te database.
Are there a options where I can tell csync2 to update the hosts in the
database and don't abort the sync on a host that is not resolvable or
online yet?
That has nothing to do with this pull request.
please post on the mailing list,
and try to elaborate a bit,
I for one did not really get what you are asking.
|
I had quite some trouble figuring out what was wrong with my csync2 setup using NAT, so I added more clear error and debug messages to figure out what;s going on.
The paper.pdf might also be clearer on the host syntax: hostname@interfacename can be misleading, hostname@alternative_NATted_hostname might help people.
The restrictions on the config names lead to hard to read confignames if you have a lot of hierarchic files. Adding A-Z -_. makes things easier to read.