Skip to content

Commit

Permalink
move log message to info, simplify for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jreiberkyle committed May 11, 2023
1 parent d71415a commit 5ee4bd2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions planet/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,9 @@ def read(self) -> dict:

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

0 comments on commit 5ee4bd2

Please sign in to comment.