[networkcfg] fix python crash
open(path, "w") returns a TextIOWrapper, open(path, "wb") returns a BufferedWriter, .. neither of which is one of the types that os.chmod() consumes. Use fileno(), an integer file-descriptor. FIXES #2294
This commit is contained in:
parent
1f3ebad92d
commit
5568d22549
@ -155,7 +155,7 @@ network:
|
||||
"""
|
||||
with open(renderer_file, 'w') as f:
|
||||
f.writelines(nm_renderer)
|
||||
os.chmod(f, 0o600)
|
||||
os.chmod(f.fileno(), 0o600)
|
||||
|
||||
# Copy existing Netplan configuration
|
||||
for cfg in glob.glob(os.path.join(source_netplan, "*.yaml")):
|
||||
|
Loading…
Reference in New Issue
Block a user