@@ -69,22 +69,22 @@ def _read_client_id():
6969
7070def _store_client_id (client_id ):
7171 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 )
8278
8379
8480def get_client_id ():
8581 """Return unique client ID of the instance, generate new if not exists."""
8682 client_id = _read_client_id ()
8783 if not client_id :
8884 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 )
9090 return client_id
0 commit comments