| @@ 228-241 (lines=14) @@ | ||
| 225 | return list(one_or_more_strings) |
|
| 226 | ||
| 227 | ||
| 228 | def update_yaml_list_or_string(current_contents, new_contents, prepend=False): |
|
| 229 | result = [] |
|
| 230 | if current_contents: |
|
| 231 | result += _strings_to_list(current_contents) |
|
| 232 | if new_contents: |
|
| 233 | if prepend: |
|
| 234 | result = _strings_to_list(new_contents) + result |
|
| 235 | else: |
|
| 236 | result += _strings_to_list(new_contents) |
|
| 237 | if not result: |
|
| 238 | result = "" |
|
| 239 | if len(result) == 1: |
|
| 240 | result = result[0] |
|
| 241 | return result |
|
| 242 | ||
| @@ 68-78 (lines=11) @@ | ||
| 65 | return list(one_or_more_strings) |
|
| 66 | ||
| 67 | ||
| 68 | def update_yaml_list_or_string(current_contents, new_contents): |
|
| 69 | result = [] |
|
| 70 | if current_contents: |
|
| 71 | result += _strings_to_list(current_contents) |
|
| 72 | if new_contents: |
|
| 73 | result += _strings_to_list(new_contents) |
|
| 74 | if not result: |
|
| 75 | result = "" |
|
| 76 | if len(result) == 1: |
|
| 77 | result = result[0] |
|
| 78 | return result |
|
| 79 | ||