We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25924b3 commit 8ace7a6Copy full SHA for 8ace7a6
hostlist/hostlist.py
@@ -162,10 +162,10 @@ def compress_range(nodelist):
162
# check to see if there are prepending zeros in first node
163
lead_zeros = 0
164
lead_zeros_str = ''
165
- for digit in list_of_nodes[0]:
166
- if digit == '0':
167
- lead_zeros = lead_zeros + 1
168
- lead_zeros_str = lead_zeros_str + '0'
+ num_range = re.sub("a-zA-Z]*", "", list_of_nodes[0])
+ if num_range[0] == '0': # if first digit in range is 0
+ lead_zeros = lead_zeros + 1
+ lead_zeros_str = lead_zeros_str + '0'
169
170
# check if node is in the following format: node1-2,node3-4
171
if "-" in list_of_nodes[0]:
0 commit comments