utils: change os.mkdir to self.mkpath to create intermediary dirs

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2024-08-15 00:44:55 -03:00
parent 39539f381d
commit a3eca67f38

View file

@ -68,7 +68,7 @@ class Install(_install):
polkit = polkit_template.format(LIB_PATH=self.install_lib)
if not os.path.exists(prefix + '/usr/share/polkit-1/actions/'):
os.mkdir(prefix + '/usr/share/polkit-1/actions/')
self.mkpath(prefix + '/usr/share/polkit-1/actions/')
with open(prefix + '/usr/share/polkit-1/actions/' + pkexec_action_name, 'w') as f:
f.write(polkit)
os.chmod(prefix + '/usr/share/polkit-1/actions/' + pkexec_action_name, 0o644)