Skip to content

Workdir lookup fails if a directory can't be accessed #765

Description

@gbenhaim

When running any lago command, without explicitly providing the path to the workdir, lago tries to locate the workdir by himself (the logic can be found in workdir.resolve_workdir_path).
This logic doesn't take into account that some of the directories in the chain will not have sufficient permissions, e.g

00:23:23.550 Error occured, aborting
00:23:23.550 Traceback (most recent call last):
00:23:23.551   File "/usr/lib/python2.7/site-packages/lago/cmd.py", line 969, in main
00:23:23.553     cli_plugins[args.verb].do_run(args)
00:23:23.554   File "/usr/lib/python2.7/site-packages/lago/plugins/cli.py", line 184, in do_run
00:23:23.556     self._do_run(**vars(args))
00:23:23.557   File "/usr/lib/python2.7/site-packages/lago/utils.py", line 488, in wrapper
00:23:23.559     workdir_path = workdir_class.resolve_workdir_path(workdir_path)
00:23:23.560   File "/usr/lib/python2.7/site-packages/lago/workdir.py", line 380, in resolve_workdir_path
00:23:23.562     dirs = os.listdir(path)
00:23:23.562 OSError: [Errno 13] Permission denied: 'systemd-private-7e82a7008cc440bb9aba9de13d6b120f-chronyd.service-teWYQa'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions