Code Duplication    Length = 11-14 lines in 2 locations

ssg/yaml.py 1 location

@@ 209-222 (lines=14) @@
206
        return list(one_or_more_strings)
207
208
209
def update_yaml_list_or_string(current_contents, new_contents, prepend=False):
210
    result = []
211
    if current_contents:
212
        result += _strings_to_list(current_contents)
213
    if new_contents:
214
        if prepend:
215
            result = _strings_to_list(new_contents) + result
216
        else:
217
            result += _strings_to_list(new_contents)
218
    if not result:
219
        result = ""
220
    if len(result) == 1:
221
        result = result[0]
222
    return result
223
224
225
def convert_string_to_bool(string):

ssg/ansible.py 1 location

@@ 82-92 (lines=11) @@
79
        return list(one_or_more_strings)
80
81
82
def update_yaml_list_or_string(current_contents, new_contents):
83
    result = []
84
    if current_contents:
85
        result += _strings_to_list(current_contents)
86
    if new_contents:
87
        result += _strings_to_list(new_contents)
88
    if not result:
89
        result = ""
90
    if len(result) == 1:
91
        result = result[0]
92
    return result
93