@@ -69,22 +69,22 @@ def _read_client_id():
69
69
70
70
def _store_client_id (client_id ):
71
71
config = __read_config ()
72
- try :
73
- if not os .path .exists (RP_FOLDER_PATH ):
74
- os .makedirs (RP_FOLDER_PATH )
75
- config .set (__NoSectionConfigParser .DEFAULT_SECTION , CLIENT_ID_PROPERTY ,
76
- client_id )
77
- with open (RP_PROPERTIES_FILE_PATH , 'w' ) as fp :
78
- config .write (fp )
79
- except (PermissionError , IOError ) as error :
80
- logger .exception ('[%s] Unknown exception has occurred. '
81
- 'Skipping client ID saving.' , error )
72
+ if not os .path .exists (RP_FOLDER_PATH ):
73
+ os .makedirs (RP_FOLDER_PATH )
74
+ config .set (__NoSectionConfigParser .DEFAULT_SECTION , CLIENT_ID_PROPERTY ,
75
+ client_id )
76
+ with open (RP_PROPERTIES_FILE_PATH , 'w' ) as fp :
77
+ config .write (fp )
82
78
83
79
84
80
def get_client_id ():
85
81
"""Return unique client ID of the instance, generate new if not exists."""
86
82
client_id = _read_client_id ()
87
83
if not client_id :
88
84
client_id = str (uuid4 ())
89
- _store_client_id (client_id )
85
+ try :
86
+ _store_client_id (client_id )
87
+ except (PermissionError , IOError ) as error :
88
+ logger .exception ('[%s] Unknown exception has occurred. '
89
+ 'Skipping client ID saving.' , error )
90
90
return client_id
0 commit comments