Skip to content

Commit 5ee4bd2

Browse files
committed
move log message to info, simplify for readability
1 parent d71415a commit 5ee4bd2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

planet/auth.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,9 @@ def read(self) -> dict:
263263

264264
def _enforce_permissions(self):
265265
'''if the file's permissions are not what they should be, fix them'''
266-
try:
266+
if self.path.exists():
267267
# in octal, permissions is the last three bits of the mode
268268
file_permissions = self.path.stat().st_mode & 0o777
269269
if file_permissions != self.permissions:
270-
LOGGER.debug(
271-
f'{self.path} permissions are {oct(file_permissions)}, '
272-
f'should be {oct(self.permissions)}. Fixing.')
270+
LOGGER.info('Fixing planet secret file permissions.')
273271
self.path.chmod(self.permissions)
274-
except FileNotFoundError:
275-
# just skip it if the secret file doesn't exist
276-
pass

0 commit comments

Comments
 (0)