MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / _get_user_id

Function _get_user_id

mssqlcli/telemetry.py:174–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173@decorators.suppress_all_exceptions(fallback_return='')
174def _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
188def _user_id_file_is_old(id_file_path):

Callers 1

_get_base_propertiesMethod · 0.85

Calls 3

_user_id_file_is_oldFunction · 0.85
_generate_user_idFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected