mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-10 19:23:53 +01:00
fixed hostname not split (+) in python
This commit is contained in:
1 parent
39b1f5bbf2
commit
f31fa92516
3 files changed
+51
-9
No files matched your search
+18
-1
@@ -260,4 +260,21 @@ def merge_args(*args):
|
||||
return (ret,)
|
||||
|
||||
else:
|
||||
raise ValueError("Multiple dictionaries passes cannot merge args")
|
||||
raise ValueError("Multiple dictionaries passes cannot merge args")
|
||||
|
||||
|
||||
def hostname_list(args):
|
||||
"""
|
||||
Generates a list from a hostname string
|
||||
* Lists are passed through
|
||||
* as are tuples (conversion in pybind11 to vector)
|
||||
* if + is found it splits the string
|
||||
"""
|
||||
if isinstance(args, (list, tuple)):
|
||||
return args
|
||||
elif(isinstance(args, str)):
|
||||
hosts = args.split('+')
|
||||
hosts = [it for it in hosts if len(it)]
|
||||
return hosts
|
||||
else:
|
||||
raise ValueError("hostname needs to be string or list of strings")
|
||||
Reference in new issue
Block a user