Skip to content

Commit

Permalink
fix: use proper octal notation for file permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Styk <[email protected]>
  • Loading branch information
StykMartin committed Oct 28, 2024
1 parent a4ce071 commit 33474d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions LabController/src/bkr/labcontroller/log_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def open_ro(self):
return open(self.path, 'r')

def __enter__(self):
makedirs_ignore(os.path.dirname(self.path), 0755)
makedirs_ignore(os.path.dirname(self.path), 0o755)
created = False
if self.create:
try:
# stdio does not have any mode string which corresponds to this
# combination of flags, so we have to use raw os.open :-(
fd = os.open(self.path, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0644)
fd = os.open(self.path, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0o644)
created = True
except (OSError, IOError) as e:
if e.errno != errno.EEXIST:
Expand Down
4 changes: 2 additions & 2 deletions LabController/src/bkr/labcontroller/test_netboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def test_kernel_options_are_not_quoted(self):

def test_doesnt_overwrite_existing_default_config(self):
pxelinux_dir = os.path.join(self.tftp_root, 'pxelinux.cfg')
makedirs_ignore(pxelinux_dir, mode=0755)
makedirs_ignore(pxelinux_dir, mode=0o755)
pxelinux_default_path = os.path.join(pxelinux_dir, 'default')
# in reality it will probably be a menu
custom = '''
Expand Down Expand Up @@ -378,7 +378,7 @@ def test_kernel_options_are_not_quoted(self):

def test_doesnt_overwrite_existing_default_config(self):
ipxe_dir = os.path.join(self.tftp_root, 'ipxe')
makedirs_ignore(ipxe_dir, mode=0755)
makedirs_ignore(ipxe_dir, mode=0o755)
ipxe_default_path = os.path.join(ipxe_dir, 'default')
# in reality it will probably be a menu
custom = '''#!ipxe
Expand Down

0 comments on commit 33474d2

Please sign in to comment.