Merges the values between the current and previous run of the script.
(current, previous)
| 175 | ########################################################################################### |
| 176 | # private joining functions |
| 177 | def __merge_json_values(current, previous): |
| 178 | """Merges the values between the current and previous run of the script.""" |
| 179 | for value in current: |
| 180 | name = value['name'] |
| 181 | |
| 182 | # Find the previous value |
| 183 | previous_value = __find_and_remove_value(previous, value) |
| 184 | |
| 185 | if previous_value is not None: |
| 186 | flags = value['flags'] |
| 187 | previous_flags = previous_value['flags'] |
| 188 | |
| 189 | if flags != previous_flags: |
| 190 | logging.warning( |
| 191 | 'Flags for %s are different. Using previous value.', name) |
| 192 | |
| 193 | value['flags'] = previous_flags |
| 194 | else: |
| 195 | logging.warning('Value %s is a new value', name) |
| 196 | |
| 197 | for value in previous: |
| 198 | name = value['name'] |
| 199 | logging.warning( |
| 200 | 'Value %s not present in current run. Appending value.', name) |
| 201 | |
| 202 | current.append(value) |
| 203 | |
| 204 | |
| 205 | def __find_and_remove_value(list, compare): |
no test coverage detected
searching dependent graphs…