root / lib / utils / algo.py @ 31d3b918
History | View | Annotate | Download (7.8 kB)
1 | 4fd029cf | Michael Hanselmann | #
|
---|---|---|---|
2 | 4fd029cf | Michael Hanselmann | #
|
3 | 4fd029cf | Michael Hanselmann | |
4 | 4fd029cf | Michael Hanselmann | # Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
|
5 | 4fd029cf | Michael Hanselmann | #
|
6 | 4fd029cf | Michael Hanselmann | # This program is free software; you can redistribute it and/or modify
|
7 | 4fd029cf | Michael Hanselmann | # it under the terms of the GNU General Public License as published by
|
8 | 4fd029cf | Michael Hanselmann | # the Free Software Foundation; either version 2 of the License, or
|
9 | 4fd029cf | Michael Hanselmann | # (at your option) any later version.
|
10 | 4fd029cf | Michael Hanselmann | #
|
11 | 4fd029cf | Michael Hanselmann | # This program is distributed in the hope that it will be useful, but
|
12 | 4fd029cf | Michael Hanselmann | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 4fd029cf | Michael Hanselmann | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 4fd029cf | Michael Hanselmann | # General Public License for more details.
|
15 | 4fd029cf | Michael Hanselmann | #
|
16 | 4fd029cf | Michael Hanselmann | # You should have received a copy of the GNU General Public License
|
17 | 4fd029cf | Michael Hanselmann | # along with this program; if not, write to the Free Software
|
18 | 4fd029cf | Michael Hanselmann | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
19 | 4fd029cf | Michael Hanselmann | # 02110-1301, USA.
|
20 | 4fd029cf | Michael Hanselmann | |
21 | 4fd029cf | Michael Hanselmann | """Utility functions with algorithms.
|
22 | 4fd029cf | Michael Hanselmann |
|
23 | 4fd029cf | Michael Hanselmann | """
|
24 | 4fd029cf | Michael Hanselmann | |
25 | 4fd029cf | Michael Hanselmann | import re |
26 | 7d444d59 | Michael Hanselmann | import time |
27 | 9c709b31 | René Nussbaumer | import itertools |
28 | 4fd029cf | Michael Hanselmann | |
29 | 6d0accae | Michael Hanselmann | from ganeti import compat |
30 | 6d0accae | Michael Hanselmann | from ganeti.utils import text |
31 | 6d0accae | Michael Hanselmann | |
32 | 4fd029cf | Michael Hanselmann | |
33 | 7d4da09e | Michael Hanselmann | _SORTER_GROUPS = 8
|
34 | 78f99abb | Michele Tartara | _SORTER_RE = re.compile("^%s(.*)$" % (_SORTER_GROUPS * r"(\D+|\d+)?")) |
35 | 4fd029cf | Michael Hanselmann | |
36 | 4fd029cf | Michael Hanselmann | |
37 | 4fd029cf | Michael Hanselmann | def UniqueSequence(seq): |
38 | 4fd029cf | Michael Hanselmann | """Returns a list with unique elements.
|
39 | 4fd029cf | Michael Hanselmann |
|
40 | 4fd029cf | Michael Hanselmann | Element order is preserved.
|
41 | 4fd029cf | Michael Hanselmann |
|
42 | 4fd029cf | Michael Hanselmann | @type seq: sequence
|
43 | 4fd029cf | Michael Hanselmann | @param seq: the sequence with the source elements
|
44 | 4fd029cf | Michael Hanselmann | @rtype: list
|
45 | 4fd029cf | Michael Hanselmann | @return: list of unique elements from seq
|
46 | 4fd029cf | Michael Hanselmann |
|
47 | 4fd029cf | Michael Hanselmann | """
|
48 | 4fd029cf | Michael Hanselmann | seen = set()
|
49 | 4fd029cf | Michael Hanselmann | return [i for i in seq if i not in seen and not seen.add(i)] |
50 | 4fd029cf | Michael Hanselmann | |
51 | 4fd029cf | Michael Hanselmann | |
52 | cdf71b12 | Andrea Spadaccini | def JoinDisjointDicts(dict_a, dict_b): |
53 | cdf71b12 | Andrea Spadaccini | """Joins dictionaries with no conflicting keys.
|
54 | cdf71b12 | Andrea Spadaccini |
|
55 | cdf71b12 | Andrea Spadaccini | Enforces the constraint that the two key sets must be disjoint, and then
|
56 | cdf71b12 | Andrea Spadaccini | merges the two dictionaries in a new dictionary that is returned to the
|
57 | cdf71b12 | Andrea Spadaccini | caller.
|
58 | cdf71b12 | Andrea Spadaccini |
|
59 | cdf71b12 | Andrea Spadaccini | @type dict_a: dict
|
60 | cdf71b12 | Andrea Spadaccini | @param dict_a: the first dictionary
|
61 | cdf71b12 | Andrea Spadaccini | @type dict_b: dict
|
62 | cdf71b12 | Andrea Spadaccini | @param dict_b: the second dictionary
|
63 | cdf71b12 | Andrea Spadaccini | @rtype: dict
|
64 | cdf71b12 | Andrea Spadaccini | @return: a new dictionary containing all the key/value pairs contained in the
|
65 | cdf71b12 | Andrea Spadaccini | two dictionaries.
|
66 | cdf71b12 | Andrea Spadaccini |
|
67 | cdf71b12 | Andrea Spadaccini | """
|
68 | cdf71b12 | Andrea Spadaccini | assert not (set(dict_a) & set(dict_b)), ("Duplicate keys found while joining" |
69 | cdf71b12 | Andrea Spadaccini | " %s and %s" % (dict_a, dict_b))
|
70 | cdf71b12 | Andrea Spadaccini | result = dict_a.copy() |
71 | cdf71b12 | Andrea Spadaccini | result.update(dict_b) |
72 | cdf71b12 | Andrea Spadaccini | return result
|
73 | cdf71b12 | Andrea Spadaccini | |
74 | cdf71b12 | Andrea Spadaccini | |
75 | 4fd029cf | Michael Hanselmann | def FindDuplicates(seq): |
76 | 4fd029cf | Michael Hanselmann | """Identifies duplicates in a list.
|
77 | 4fd029cf | Michael Hanselmann |
|
78 | 4fd029cf | Michael Hanselmann | Does not preserve element order.
|
79 | 4fd029cf | Michael Hanselmann |
|
80 | 4fd029cf | Michael Hanselmann | @type seq: sequence
|
81 | 4fd029cf | Michael Hanselmann | @param seq: Sequence with source elements
|
82 | 4fd029cf | Michael Hanselmann | @rtype: list
|
83 | 4fd029cf | Michael Hanselmann | @return: List of duplicate elements from seq
|
84 | 4fd029cf | Michael Hanselmann |
|
85 | 4fd029cf | Michael Hanselmann | """
|
86 | 4fd029cf | Michael Hanselmann | dup = set()
|
87 | 4fd029cf | Michael Hanselmann | seen = set()
|
88 | 4fd029cf | Michael Hanselmann | |
89 | 4fd029cf | Michael Hanselmann | for item in seq: |
90 | 4fd029cf | Michael Hanselmann | if item in seen: |
91 | 4fd029cf | Michael Hanselmann | dup.add(item) |
92 | 4fd029cf | Michael Hanselmann | else:
|
93 | 4fd029cf | Michael Hanselmann | seen.add(item) |
94 | 4fd029cf | Michael Hanselmann | |
95 | 4fd029cf | Michael Hanselmann | return list(dup) |
96 | 4fd029cf | Michael Hanselmann | |
97 | 4fd029cf | Michael Hanselmann | |
98 | 31d3b918 | Santi Raffa | #pylint: disable=W0142
|
99 | 31d3b918 | Santi Raffa | # (use of *-magic in argument list)
|
100 | 92389be9 | Santi Raffa | def GetRepeatedKeys(*dicts): |
101 | 92389be9 | Santi Raffa | """Return the set of keys defined multiple times in the given dicts.
|
102 | 92389be9 | Santi Raffa |
|
103 | 92389be9 | Santi Raffa | >>> GetRepeatedKeys({"foo": 1, "bar": 2},
|
104 | 92389be9 | Santi Raffa | ... {"foo": 5, "baz": 7}
|
105 | 92389be9 | Santi Raffa | ... )
|
106 | 92389be9 | Santi Raffa | set("foo")
|
107 | 92389be9 | Santi Raffa |
|
108 | 92389be9 | Santi Raffa | @type dicts: dict
|
109 | 92389be9 | Santi Raffa | @param dicts: The dictionaries to check for duplicate keys.
|
110 | 92389be9 | Santi Raffa | @rtype: set
|
111 | 92389be9 | Santi Raffa | @return: Keys used more than once across all dicts
|
112 | 92389be9 | Santi Raffa |
|
113 | 92389be9 | Santi Raffa | """
|
114 | 92389be9 | Santi Raffa | if len(dicts) < 2: |
115 | 92389be9 | Santi Raffa | return set() |
116 | 92389be9 | Santi Raffa | |
117 | 92389be9 | Santi Raffa | keys = [] |
118 | 92389be9 | Santi Raffa | for dictionary in dicts: |
119 | 92389be9 | Santi Raffa | keys.extend(dictionary) |
120 | 92389be9 | Santi Raffa | |
121 | 92389be9 | Santi Raffa | return set(FindDuplicates(keys)) |
122 | 92389be9 | Santi Raffa | |
123 | 92389be9 | Santi Raffa | |
124 | 4fd029cf | Michael Hanselmann | def _NiceSortTryInt(val): |
125 | 4fd029cf | Michael Hanselmann | """Attempts to convert a string to an integer.
|
126 | 4fd029cf | Michael Hanselmann |
|
127 | 4fd029cf | Michael Hanselmann | """
|
128 | dd27bc21 | Michael Hanselmann | if val and val.isdigit(): |
129 | 4fd029cf | Michael Hanselmann | return int(val) |
130 | 4fd029cf | Michael Hanselmann | else:
|
131 | 4fd029cf | Michael Hanselmann | return val
|
132 | 4fd029cf | Michael Hanselmann | |
133 | 4fd029cf | Michael Hanselmann | |
134 | 7d4da09e | Michael Hanselmann | def NiceSortKey(value): |
135 | 4fd029cf | Michael Hanselmann | """Extract key for sorting.
|
136 | 4fd029cf | Michael Hanselmann |
|
137 | 4fd029cf | Michael Hanselmann | """
|
138 | 4fd029cf | Michael Hanselmann | return [_NiceSortTryInt(grp)
|
139 | 4fd029cf | Michael Hanselmann | for grp in _SORTER_RE.match(value).groups()] |
140 | 4fd029cf | Michael Hanselmann | |
141 | 4fd029cf | Michael Hanselmann | |
142 | 4fd029cf | Michael Hanselmann | def NiceSort(values, key=None): |
143 | 4fd029cf | Michael Hanselmann | """Sort a list of strings based on digit and non-digit groupings.
|
144 | 4fd029cf | Michael Hanselmann |
|
145 | 4fd029cf | Michael Hanselmann | Given a list of names C{['a1', 'a10', 'a11', 'a2']} this function
|
146 | 4fd029cf | Michael Hanselmann | will sort the list in the logical order C{['a1', 'a2', 'a10',
|
147 | 4fd029cf | Michael Hanselmann | 'a11']}.
|
148 | 4fd029cf | Michael Hanselmann |
|
149 | 4fd029cf | Michael Hanselmann | The sort algorithm breaks each name in groups of either only-digits
|
150 | 4fd029cf | Michael Hanselmann | or no-digits. Only the first eight such groups are considered, and
|
151 | 4fd029cf | Michael Hanselmann | after that we just use what's left of the string.
|
152 | 4fd029cf | Michael Hanselmann |
|
153 | 4fd029cf | Michael Hanselmann | @type values: list
|
154 | 4fd029cf | Michael Hanselmann | @param values: the names to be sorted
|
155 | 4fd029cf | Michael Hanselmann | @type key: callable or None
|
156 | 4fd029cf | Michael Hanselmann | @param key: function of one argument to extract a comparison key from each
|
157 | 4fd029cf | Michael Hanselmann | list element, must return string
|
158 | 4fd029cf | Michael Hanselmann | @rtype: list
|
159 | 4fd029cf | Michael Hanselmann | @return: a copy of the name list sorted with our algorithm
|
160 | 4fd029cf | Michael Hanselmann |
|
161 | 4fd029cf | Michael Hanselmann | """
|
162 | 4fd029cf | Michael Hanselmann | if key is None: |
163 | 7d4da09e | Michael Hanselmann | keyfunc = NiceSortKey |
164 | 4fd029cf | Michael Hanselmann | else:
|
165 | 7d4da09e | Michael Hanselmann | keyfunc = lambda value: NiceSortKey(key(value))
|
166 | 4fd029cf | Michael Hanselmann | |
167 | 4fd029cf | Michael Hanselmann | return sorted(values, key=keyfunc) |
168 | 7d444d59 | Michael Hanselmann | |
169 | 7d444d59 | Michael Hanselmann | |
170 | 0a9a0e5a | René Nussbaumer | def InvertDict(dict_in): |
171 | 0a9a0e5a | René Nussbaumer | """Inverts the key/value mapping of a dict.
|
172 | 0a9a0e5a | René Nussbaumer |
|
173 | 0a9a0e5a | René Nussbaumer | @param dict_in: The dict to invert
|
174 | d5fca545 | Iustin Pop | @return: the inverted dict
|
175 | 0a9a0e5a | René Nussbaumer |
|
176 | 0a9a0e5a | René Nussbaumer | """
|
177 | 0a9a0e5a | René Nussbaumer | return dict(zip(dict_in.values(), dict_in.keys())) |
178 | 0a9a0e5a | René Nussbaumer | |
179 | 0a9a0e5a | René Nussbaumer | |
180 | d60946d9 | René Nussbaumer | def InsertAtPos(src, pos, other): |
181 | d60946d9 | René Nussbaumer | """Inserts C{other} at given C{pos} into C{src}.
|
182 | d60946d9 | René Nussbaumer |
|
183 | d60946d9 | René Nussbaumer | @note: This function does not modify C{src} in place but returns a new copy
|
184 | d60946d9 | René Nussbaumer |
|
185 | d60946d9 | René Nussbaumer | @type src: list
|
186 | d60946d9 | René Nussbaumer | @param src: The source list in which we want insert elements
|
187 | d60946d9 | René Nussbaumer | @type pos: int
|
188 | d60946d9 | René Nussbaumer | @param pos: The position where we want to start insert C{other}
|
189 | d60946d9 | René Nussbaumer | @type other: list
|
190 | d60946d9 | René Nussbaumer | @param other: The other list to insert into C{src}
|
191 | d60946d9 | René Nussbaumer | @return: A copy of C{src} with C{other} inserted at C{pos}
|
192 | d60946d9 | René Nussbaumer |
|
193 | d60946d9 | René Nussbaumer | """
|
194 | d60946d9 | René Nussbaumer | new = src[:pos] |
195 | d60946d9 | René Nussbaumer | new.extend(other) |
196 | d60946d9 | René Nussbaumer | new.extend(src[pos:]) |
197 | d60946d9 | René Nussbaumer | |
198 | d60946d9 | René Nussbaumer | return new
|
199 | d60946d9 | René Nussbaumer | |
200 | d60946d9 | René Nussbaumer | |
201 | 6d0accae | Michael Hanselmann | def SequenceToDict(seq, key=compat.fst): |
202 | 6d0accae | Michael Hanselmann | """Converts a sequence to a dictionary with duplicate detection.
|
203 | 6d0accae | Michael Hanselmann |
|
204 | 6d0accae | Michael Hanselmann | @type seq: sequen
|
205 | 6d0accae | Michael Hanselmann | @param seq: Input sequence
|
206 | 6d0accae | Michael Hanselmann | @type key: callable
|
207 | 6d0accae | Michael Hanselmann | @param key: Function for retrieving dictionary key from sequence element
|
208 | 6d0accae | Michael Hanselmann | @rtype: dict
|
209 | 6d0accae | Michael Hanselmann |
|
210 | 6d0accae | Michael Hanselmann | """
|
211 | 6d0accae | Michael Hanselmann | keys = map(key, seq)
|
212 | 6d0accae | Michael Hanselmann | |
213 | 6d0accae | Michael Hanselmann | duplicates = FindDuplicates(keys) |
214 | 6d0accae | Michael Hanselmann | if duplicates:
|
215 | 6d0accae | Michael Hanselmann | raise ValueError("Duplicate keys found: %s" % text.CommaJoin(duplicates)) |
216 | 6d0accae | Michael Hanselmann | |
217 | 6d0accae | Michael Hanselmann | assert len(keys) == len(seq) |
218 | 6d0accae | Michael Hanselmann | |
219 | 6d0accae | Michael Hanselmann | return dict(zip(keys, seq)) |
220 | 6d0accae | Michael Hanselmann | |
221 | 6d0accae | Michael Hanselmann | |
222 | 9c709b31 | René Nussbaumer | def _MakeFlatToDict(data): |
223 | 9c709b31 | René Nussbaumer | """Helper function for C{FlatToDict}.
|
224 | 9c709b31 | René Nussbaumer |
|
225 | 9c709b31 | René Nussbaumer | This function is recursively called
|
226 | 9c709b31 | René Nussbaumer |
|
227 | 9c709b31 | René Nussbaumer | @param data: The input data as described in C{FlatToDict}, already splitted
|
228 | 9c709b31 | René Nussbaumer | @returns: The so far converted dict
|
229 | 9c709b31 | René Nussbaumer |
|
230 | 9c709b31 | René Nussbaumer | """
|
231 | 9c709b31 | René Nussbaumer | if not compat.fst(compat.fst(data)): |
232 | 9c709b31 | René Nussbaumer | assert len(data) == 1, \ |
233 | 9c709b31 | René Nussbaumer | "not bottom most element, found %d elements, expected 1" % len(data) |
234 | 9c709b31 | René Nussbaumer | return compat.snd(compat.fst(data))
|
235 | 9c709b31 | René Nussbaumer | |
236 | 9c709b31 | René Nussbaumer | keyfn = lambda e: compat.fst(e).pop(0) |
237 | 9c709b31 | René Nussbaumer | return dict([(k, _MakeFlatToDict(list(g))) |
238 | 9c709b31 | René Nussbaumer | for (k, g) in itertools.groupby(sorted(data), keyfn)]) |
239 | 9c709b31 | René Nussbaumer | |
240 | 9c709b31 | René Nussbaumer | |
241 | 9c709b31 | René Nussbaumer | def FlatToDict(data, field_sep="/"): |
242 | 9c709b31 | René Nussbaumer | """Converts a flat structure to a fully fledged dict.
|
243 | 9c709b31 | René Nussbaumer |
|
244 | 9c709b31 | René Nussbaumer | It accept a list of tuples in the form::
|
245 | 9c709b31 | René Nussbaumer |
|
246 | 9c709b31 | René Nussbaumer | [
|
247 | 9c709b31 | René Nussbaumer | ("foo/bar", {"key1": "data1", "key2": "data2"}),
|
248 | 9c709b31 | René Nussbaumer | ("foo/baz", {"key3" :"data3" }),
|
249 | 9c709b31 | René Nussbaumer | ]
|
250 | 9c709b31 | René Nussbaumer |
|
251 | 9c709b31 | René Nussbaumer | where the first element is the key separated by C{field_sep}.
|
252 | 9c709b31 | René Nussbaumer |
|
253 | 9c709b31 | René Nussbaumer | This would then return::
|
254 | 9c709b31 | René Nussbaumer |
|
255 | 9c709b31 | René Nussbaumer | {
|
256 | 9c709b31 | René Nussbaumer | "foo": {
|
257 | 9c709b31 | René Nussbaumer | "bar": {"key1": "data1", "key2": "data2"},
|
258 | 9c709b31 | René Nussbaumer | "baz": {"key3" :"data3" },
|
259 | 9c709b31 | René Nussbaumer | },
|
260 | 9c709b31 | René Nussbaumer | }
|
261 | 9c709b31 | René Nussbaumer |
|
262 | 9c709b31 | René Nussbaumer | @type data: list of tuple
|
263 | 9c709b31 | René Nussbaumer | @param data: Input list to convert
|
264 | 9c709b31 | René Nussbaumer | @type field_sep: str
|
265 | 9c709b31 | René Nussbaumer | @param field_sep: The separator for the first field of the tuple
|
266 | 9c709b31 | René Nussbaumer | @returns: A dict based on the input list
|
267 | 9c709b31 | René Nussbaumer |
|
268 | 9c709b31 | René Nussbaumer | """
|
269 | 9c709b31 | René Nussbaumer | return _MakeFlatToDict([(keys.split(field_sep), value)
|
270 | 9c709b31 | René Nussbaumer | for (keys, value) in data]) |
271 | 9c709b31 | René Nussbaumer | |
272 | 9c709b31 | René Nussbaumer | |
273 | 7d444d59 | Michael Hanselmann | class RunningTimeout(object): |
274 | 7d444d59 | Michael Hanselmann | """Class to calculate remaining timeout when doing several operations.
|
275 | 7d444d59 | Michael Hanselmann |
|
276 | 7d444d59 | Michael Hanselmann | """
|
277 | 7d444d59 | Michael Hanselmann | __slots__ = [ |
278 | 7d444d59 | Michael Hanselmann | "_allow_negative",
|
279 | 7d444d59 | Michael Hanselmann | "_start_time",
|
280 | 7d444d59 | Michael Hanselmann | "_time_fn",
|
281 | 7d444d59 | Michael Hanselmann | "_timeout",
|
282 | 7d444d59 | Michael Hanselmann | ] |
283 | 7d444d59 | Michael Hanselmann | |
284 | 7d444d59 | Michael Hanselmann | def __init__(self, timeout, allow_negative, _time_fn=time.time): |
285 | 7d444d59 | Michael Hanselmann | """Initializes this class.
|
286 | 7d444d59 | Michael Hanselmann |
|
287 | 7d444d59 | Michael Hanselmann | @type timeout: float
|
288 | 7d444d59 | Michael Hanselmann | @param timeout: Timeout duration
|
289 | 7d444d59 | Michael Hanselmann | @type allow_negative: bool
|
290 | 7d444d59 | Michael Hanselmann | @param allow_negative: Whether to return values below zero
|
291 | 7d444d59 | Michael Hanselmann | @param _time_fn: Time function for unittests
|
292 | 7d444d59 | Michael Hanselmann |
|
293 | 7d444d59 | Michael Hanselmann | """
|
294 | 7d444d59 | Michael Hanselmann | object.__init__(self) |
295 | 7d444d59 | Michael Hanselmann | |
296 | 7d444d59 | Michael Hanselmann | if timeout is not None and timeout < 0.0: |
297 | 7d444d59 | Michael Hanselmann | raise ValueError("Timeout must not be negative") |
298 | 7d444d59 | Michael Hanselmann | |
299 | 7d444d59 | Michael Hanselmann | self._timeout = timeout
|
300 | 7d444d59 | Michael Hanselmann | self._allow_negative = allow_negative
|
301 | 7d444d59 | Michael Hanselmann | self._time_fn = _time_fn
|
302 | 7d444d59 | Michael Hanselmann | |
303 | 7d444d59 | Michael Hanselmann | self._start_time = None |
304 | 7d444d59 | Michael Hanselmann | |
305 | 7d444d59 | Michael Hanselmann | def Remaining(self): |
306 | 7d444d59 | Michael Hanselmann | """Returns the remaining timeout.
|
307 | 7d444d59 | Michael Hanselmann |
|
308 | 7d444d59 | Michael Hanselmann | """
|
309 | 7d444d59 | Michael Hanselmann | if self._timeout is None: |
310 | 7d444d59 | Michael Hanselmann | return None |
311 | 7d444d59 | Michael Hanselmann | |
312 | 7d444d59 | Michael Hanselmann | # Get start time on first calculation
|
313 | 7d444d59 | Michael Hanselmann | if self._start_time is None: |
314 | 7d444d59 | Michael Hanselmann | self._start_time = self._time_fn() |
315 | 7d444d59 | Michael Hanselmann | |
316 | 7d444d59 | Michael Hanselmann | # Calculate remaining time
|
317 | 7d444d59 | Michael Hanselmann | remaining_timeout = self._start_time + self._timeout - self._time_fn() |
318 | 7d444d59 | Michael Hanselmann | |
319 | 7d444d59 | Michael Hanselmann | if not self._allow_negative: |
320 | 7d444d59 | Michael Hanselmann | # Ensure timeout is always >= 0
|
321 | 7d444d59 | Michael Hanselmann | return max(0.0, remaining_timeout) |
322 | 7d444d59 | Michael Hanselmann | |
323 | 7d444d59 | Michael Hanselmann | return remaining_timeout |