GithubHelp home page GithubHelp logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Ok, I will try to look into this one.

Original comment by [email protected] on 24 Sep 2010 at 6:04

  • Changed state: Accepted

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Mattias,

Thanks for the bug report. I've attached a patch where I undid the exceptionally
obtuse comp() code in dshbak into a more clear loop (with comments!) and added
a check that any zero-padding matches before collapsing numeric ranges.

This patch is quite experimental, since I rewrote the code, but I'd appreciate
it if you could give it a test and let me know of any new bugs that are 
introduced.

Thanks,
mark

Original comment by [email protected] on 28 Sep 2010 at 3:47

Attachments:

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Hi Mark!

I threw together a shell script which runs a few different inputs through 
dshbak (or any other command) and compares the output with a predefined 
expected output.

It seems that there still is a set of (artificially made up) inputs which 
renders collected host lists which if fed to pdsh would result in a new set of 
hosts (as compared to the original input). Se examples below (and in attached 
file).

To test the attached shell script, edit/alter the array of "COLLECT_COMMANDS".
I used the pshbak-command as a comparison. It is a python "rewrite" of dshbak 
and is part of Kent Engstroms python-hostlist 
(http://www.nsc.liu.se/~kent/python-hostlist/).
Hence, pshbak is not a stand alone script/program, but depends on the 
hostlist-library. The python-hostlist library is really nice though. :)


E.g. 
/home/mattias/misc/pdsh-2.22/scripts/dshbak -c << t10 ...fail for 
/home/mattias/misc/pdsh-2.22/scripts/dshbak -c
==[ Input ]=================
n1:  x
n01:  x
n2:  x
n3:  x
n5:  x
n00:  x
==[ Expected output ]=======
----------------
n[00-01,1-3,5]
----------------
 x
==[ Real output ]============
----------------
n[00-3,5]
----------------
 x
============================

Original comment by don.fanucci on 29 Sep 2010 at 1:26

Attachments:

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Thanks for the tests, that is unbelievably helpful! I guess you caught me
not doing very good testing ;-)

I get your point about using hostlist.c code, but I don't want to rewrite
dshbak in either C (or python for that matter) right now ;-) Though I wonder
how difficult it would be to rewrite in C.

For now, I'm sure there is just still some small bugs in dshbak, and I'll
add your tests to the internal dshbak testing (invoked with 'make check')
Thanks again!

Original comment by [email protected] on 29 Sep 2010 at 3:54

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
Ok, the remaining problem was that host suffixes that were numerically
the same but had a different zero-padding interfered with the detection
of ranges since only the numeric value was used as an index lookup.
Also, the zero padding of zero wasn't working.

I've simplified the whole thing by caching the zero-pad along with the numeric
value in the index-lookup hash.

Can you try this patch? It passes the tests you've 

Original comment by [email protected] on 29 Sep 2010 at 4:45

Attachments:

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
The patch seems to work fine. :)

/m

Original comment by don.fanucci on 29 Sep 2010 at 9:59

from pdsh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 10, 2024
This issue was closed by revision r1240.

Original comment by [email protected] on 22 Oct 2010 at 12:11

  • Changed state: Fixed

from pdsh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.