Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

string folding / unfolding [question] #384

Closed
jabbalaci opened this issue Jul 5, 2018 · 7 comments
Closed

string folding / unfolding [question] #384

jabbalaci opened this issue Jul 5, 2018 · 7 comments

Comments

@jabbalaci
Copy link

I found this project because I needed string folding / unfolding, i.e. convert "node[1-3]" to a list of strings (["node1", "node2", "node3"]) and vice versa. Actually, I needed it for URLs.

I included ClusterShell in my project but I figured out later that it doesn't exist for Windows :( And I develop a cross-platform software. Could someone, who knows well ClusterShell from inside, give me a hint how I could extract just the string (un)folding part? Or do you know a project that can do this advanced string manipulation?

Thanks.

@jabbalaci
Copy link
Author

I've found the answer. For string folding / unfolding, we need these 4 files only:

  • Defaults.py
  • NodeSet.py
  • NodeUtils.py
  • RangeSet.py

They also work under Windows for string (un)folding.

@thiell
Copy link
Collaborator

thiell commented Jul 5, 2018

Hi @jabbalaci -
Yes this part of the code is localized to these modules, you did well. Are you using some kind of Python package manager on Windows like pip? If so, would it help if ever we decided to separate this part under a clustershell-nodeset subpackage that could be installed without the rest?

@jabbalaci
Copy link
Author

Hi,
Thanks for the answer. Yes, I tried to install it with pip. The problem was here:

if os.geteuid() == 0:
, os.geteuid() doesn't work under Windows.
Well, a platform-independent separate package that would do string (un)folding would be useful. As I said, I don't do Linux clustering at all. However, your string (un)folding implementation works well with general strings too, thus this part could be generalized and put into a sub-package.

@degremont
Copy link
Collaborator

I think we should be able to fix setup.py in order to fix pip issue under Windows.
Likely Task and Workers classes won't work with Windows but this should be enough to install ClusterShell and use the classes you are looking for.
This will avoid having to maintain a separated package and project.

@jabbalaci
Copy link
Author

@degremont : it's also a good solution. There's no need to slice the project.

@degremont
Copy link
Collaborator

@jabbalaci Could you confirm that, if you remove the os.getuid() call in setup.py you can successfully install ClusterShell through pip on windows, and use NodeSet class?

@jabbalaci
Copy link
Author

@degremont : I tried that and it works like that under Windows. That is, I removed the os.getuid() call and left only CFGDIR = 'etc/clustershell'. Then I could install under Windows and use the NodeSet class.

thiell added a commit that referenced this issue Oct 23, 2018
Fixes #384.

Change-Id: Ic84358a75192a40fde15e86c986ca98775ea409f
cedeyn added a commit to cedeyn/clustershell that referenced this issue Mar 6, 2019
Fix proposal for 'ClusterShell timers are too fast'

Fixes cea-hpc#384
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants