Split a string in `txt` by list of delimiters in `seps` @param txt: string to split @param seps: list of separators @return: list of split units
(txt, seps)
| 265 | |
| 266 | |
| 267 | def xsplit(txt, seps): |
| 268 | """ |
| 269 | Split a string in `txt` by list of delimiters in `seps` |
| 270 | @param txt: string to split |
| 271 | @param seps: list of separators |
| 272 | @return: list of split units |
| 273 | """ |
| 274 | default_sep = seps[0] |
| 275 | for sep in seps[1:]: # we skip seps[0] because that's the default separator |
| 276 | txt = txt.replace(sep, default_sep) |
| 277 | return [i.strip() for i in txt.split(default_sep)] |
| 278 | |
| 279 | def get_hypervisor_type(apiclient): |
| 280 |