Discussion:
[Sisuite-devel] PATCH: Allow hostname-ranges with hosts that contain a '-' (HostRange.pm)
Thomas Krause
2007-08-10 17:14:05 UTC
Permalink
Attached to this mail, is the patch to allow hostnames that contain an '-'
to be used with host ranges in si_addclients. After applying the patch you
can call si_addclients like:

si_addclients --script xyz --domainname abc --hosts client\\-01-client\\-99

which adds client-01 to client-99.

Thomas Krause
Bernard Li
2007-08-10 17:23:23 UTC
Permalink
Post by Thomas Krause
Attached to this mail, is the patch to allow hostnames that contain an '-'
to be used with host ranges in si_addclients. After applying the patch you
si_addclients --script xyz --domainname abc --hosts client\\-01-client\\-99
which adds client-01 to client-99.
Thanks for the patch -- but would it also work if you do:

si_addclients --script xyz --domainname abc --hosts 'client-01-client-99'

in quotes?

Cheers,

Bernard
Thomas Krause
2007-08-10 19:25:12 UTC
Permalink
Well, this would create the single host client-01-client-99, because you
didn't escape the '-'. The correct call would be:

si_addclients --script xyz --domainname abc --hosts
'client\\-01-client\\-99'

which works with or without the quotes (I didn't change anything in this
behavior).

However by trying your example I found a small bug in my patch, that causes
an error if you are trying to add a single host with an '-' and without
escaping the '-' (e.g. 'abc-xyz'). I attached a new patch as a replacement
for the old one, which should fix the problem. Sorry for that!

Thomas Krause

-----Ursprüngliche Nachricht-----
Von: Bernard Li [mailto:***@vanhpc.org]
Gesendet: Freitag, 10. August 2007 19:23
An: Thomas Krause
Cc: sisuite-***@lists.sourceforge.net
Betreff: Re: [Sisuite-devel] PATCH: Allow hostname-ranges with hosts that
contain a '-' (HostRange.pm)
Post by Thomas Krause
Attached to this mail, is the patch to allow hostnames that contain an '-'
to be used with host ranges in si_addclients. After applying the patch you
si_addclients --script xyz --domainname abc --hosts
client\\-01-client\\-99
Post by Thomas Krause
which adds client-01 to client-99.
Thanks for the patch -- but would it also work if you do:

si_addclients --script xyz --domainname abc --hosts 'client-01-client-99'

in quotes?

Cheers,

Bernard
Bernard Li
2007-08-10 19:50:04 UTC
Permalink
Hi Thomas:

Perhaps it makes sense for us to change the delimiter '-' and use
something else which is not allowed for hostnames (for instance ':')
-- so it will become something like:

si_addclients --script xyz --domainname abc --hosts client-01:client-99

Andrea, what do you think?

Cheers,

Bernard
Post by Thomas Krause
Well, this would create the single host client-01-client-99, because you
si_addclients --script xyz --domainname abc --hosts
'client\\-01-client\\-99'
which works with or without the quotes (I didn't change anything in this
behavior).
However by trying your example I found a small bug in my patch, that causes
an error if you are trying to add a single host with an '-' and without
escaping the '-' (e.g. 'abc-xyz'). I attached a new patch as a replacement
for the old one, which should fix the problem. Sorry for that!
Thomas Krause
-----Ursprüngliche Nachricht-----
Gesendet: Freitag, 10. August 2007 19:23
An: Thomas Krause
Betreff: Re: [Sisuite-devel] PATCH: Allow hostname-ranges with hosts that
contain a '-' (HostRange.pm)
Post by Thomas Krause
Attached to this mail, is the patch to allow hostnames that contain an '-'
to be used with host ranges in si_addclients. After applying the patch you
si_addclients --script xyz --domainname abc --hosts
client\\-01-client\\-99
Post by Thomas Krause
which adds client-01 to client-99.
si_addclients --script xyz --domainname abc --hosts 'client-01-client-99'
in quotes?
Cheers,
Bernard
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sisuite-devel mailing list
https://lists.sourceforge.net/lists/listinfo/sisuite-devel
Thomas Krause
2007-08-11 09:32:32 UTC
Permalink
Hey,

You should take a look at the thread "Calling si_addclients without
'--ip-range'" in sisuite-users, where I proposed different solutions to the
problem.

Andrea preferred the escape character solution because its more backward
compatible.

While I personally don't care about that (I just started using SI), I can
imagine that simply changing the delimiter from one version to the other
could cause problems for some users.

Other than that I would agree with you that using some other delimiter would
be the cleanest solution (although I also don't like the --delimiter
solution, that Andrea suggested).

Maybe we should allow both delimiters ('-' and ':') for a few versions
(encouraging the user to use ':'), before disabling the '-' delimiter.

Thomas Krause

-----Ursprüngliche Nachricht-----
Von: Bernard Li [mailto:***@vanhpc.org]
Gesendet: Freitag, 10. August 2007 21:50
An: Thomas Krause
Cc: sisuite-***@lists.sourceforge.net
Betreff: Re: [Sisuite-devel] PATCH: Allow hostname-ranges with hosts that
contain a '-' (HostRange.pm) [FIXED VERSION]

Hi Thomas:

Perhaps it makes sense for us to change the delimiter '-' and use
something else which is not allowed for hostnames (for instance ':')
-- so it will become something like:

si_addclients --script xyz --domainname abc --hosts client-01:client-99

Andrea, what do you think?

Cheers,

Bernard
Post by Thomas Krause
Well, this would create the single host client-01-client-99, because you
si_addclients --script xyz --domainname abc --hosts
'client\\-01-client\\-99'
which works with or without the quotes (I didn't change anything in this
behavior).
However by trying your example I found a small bug in my patch, that causes
an error if you are trying to add a single host with an '-' and without
escaping the '-' (e.g. 'abc-xyz'). I attached a new patch as a replacement
for the old one, which should fix the problem. Sorry for that!
Thomas Krause
-----Ursprüngliche Nachricht-----
Gesendet: Freitag, 10. August 2007 19:23
An: Thomas Krause
Betreff: Re: [Sisuite-devel] PATCH: Allow hostname-ranges with hosts that
contain a '-' (HostRange.pm)
Post by Thomas Krause
Attached to this mail, is the patch to allow hostnames that contain an '-'
to be used with host ranges in si_addclients. After applying the patch you
si_addclients --script xyz --domainname abc --hosts
client\\-01-client\\-99
Post by Thomas Krause
which adds client-01 to client-99.
si_addclients --script xyz --domainname abc --hosts 'client-01-client-99'
in quotes?
Cheers,
Bernard
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sisuite-devel mailing list
https://lists.sourceforge.net/lists/listinfo/sisuite-devel
Andrea Righi
2007-08-11 09:52:41 UTC
Permalink
Post by Thomas Krause
Hey,
You should take a look at the thread "Calling si_addclients without
'--ip-range'" in sisuite-users, where I proposed different solutions to the
problem.
Andrea preferred the escape character solution because its more backward
compatible.
True.
Post by Thomas Krause
While I personally don't care about that (I just started using SI), I can
imagine that simply changing the delimiter from one version to the other
could cause problems for some users.
Other than that I would agree with you that using some other delimiter would
be the cleanest solution (although I also don't like the --delimiter
solution, that Andrea suggested).
Maybe we should allow both delimiters ('-' and ':') for a few versions
(encouraging the user to use ':'), before disabling the '-' delimiter.
I think the '-' character fits perfectly as a delimiter to specify ranges... I
know that for a machine the best solution should be to use something not allowed
in the domain of the hostnames, but thinking at the humans (read:
user-interface) IMHO it's better to go to a most intuitive solution.

So, the escape solution seems to be the good compromise, both for user interface
and backward compatibility.

Thomas, for now I'll merge your patch in my recent work that implements the
concept of groups in si_psh, si_pcp, si_addclients, etc. The patch is still
locally in my repository, but I'll check the complete code soon in the trunk.

BTW I'd also like to hear other opinions, objections or proposal of better
solutions if there are...

Thanks,
-Andrea

Loading...