Skip to content

Commit ec37ce6

Browse files
committed
Some code format updates
1 parent 734c4e1 commit ec37ce6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

reportportal_client/services/client_id.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ def _read_client_id():
6969

7070
def _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

8480
def 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

Comments
 (0)