()
| 172 | |
| 173 | @decorators.suppress_all_exceptions(fallback_return='') |
| 174 | def _get_user_id(): |
| 175 | config_dir = config.config_location() |
| 176 | full_path = os.path.join(config_dir, MSSQL_CLI_TELEMETRY_ID_FILE) |
| 177 | if _user_id_file_is_old(full_path) or not os.path.exists(full_path): |
| 178 | with open(full_path, 'w') as file: |
| 179 | user_id = _generate_user_id() |
| 180 | file.write(user_id) |
| 181 | return user_id |
| 182 | else: |
| 183 | with open(full_path, 'r') as file: |
| 184 | user_id = file.read() |
| 185 | return user_id |
| 186 | |
| 187 | |
| 188 | def _user_id_file_is_old(id_file_path): |
no test coverage detected