diff options
author | Jose Castillo <jcastillo@redhat.com> | 2023-06-22 11:40:32 +0100 |
---|---|---|
committer | Jake Hunsaker <jacob.r.hunsaker@gmail.com> | 2023-06-22 16:03:37 -0400 |
commit | c0865c173562c06967ae20b5a06c5b2655559a96 (patch) | |
tree | dc2719fab232d79829e03d6e9568b84641583d17 /bin | |
parent | dc75ed41c19249b14213f3bfeb26bcbd6503befb (diff) | |
download | sos-c0865c173562c06967ae20b5a06c5b2655559a96.tar.gz |
[Plugin] Fix exception when calling os.makedirs
When calling get_cmd_output_path() to create a directory
via the plugin hpssm, sos threw the following exception:
Traceback (most recent call last):
File "/root/sos/sos/report/__init__.py", line 1224, in setup
plug.setup()
File "/root/sos/sos/report/plugins/hpssm.py", line 67, in setup
logpath = self.get_cmd_output_path()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/sos/sos/report/plugins/__init__.py", line 2168,
in get_cmd_output_path
os.makedirs(cmd_output_path)
File "<frozen os>", line 225, in makedirs
FileExistsError: [Errno 17] File exists:
'/var/tmp/sos.1gdy83zb/sosreport-localhost-vbwfnpn/sos_commands/hpssm'
This was happening because the directory 'hpssm' was already created.
With this change we avoid any race where we call os.makedirs() after
we have already created the plugin directory.
Closes: RHBZ #2216608
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions