Skip to content

Commit

Permalink
call correct mkdir when trying to create /etc/rhsm/facts
Browse files Browse the repository at this point in the history
os.path has no mkdir, but os does.

traceback without the patch:

    Traceback (most recent call last):
      File "/bin/leapp", line 11, in <module>
        load_entry_point('leapp==0.16.0', 'console_scripts', 'leapp')()
      File "/usr/lib/python3.6/site-packages/leapp/cli/__init__.py", line 45, in main
        cli.command.execute('leapp version {}'.format(VERSION))
      File "/usr/lib/python3.6/site-packages/leapp/utils/clicmd.py", line 111, in execute
        args.func(args)
      File "/usr/lib/python3.6/site-packages/leapp/utils/clicmd.py", line 133, in called
        self.target(args)
      File "/usr/lib/python3.6/site-packages/leapp/cli/commands/upgrade/breadcrumbs.py", line 170, in wrapper
        breadcrumbs.save()
      File "/usr/lib/python3.6/site-packages/leapp/cli/commands/upgrade/breadcrumbs.py", line 116, in save
        self._save_rhsm_facts(doc['activities'])
      File "/usr/lib/python3.6/site-packages/leapp/cli/commands/upgrade/breadcrumbs.py", line 64, in _save_rhsm_facts
        os.path.mkdir('/etc/rhsm/facts')
    AttributeError: module 'posixpath' has no attribute 'mkdir'
  • Loading branch information
evgeni committed Oct 20, 2023
1 parent bea0f89 commit 43ee16b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/upgrade/breadcrumbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _save_rhsm_facts(self, activities):
if not os.path.exists('/etc/rhsm'):
# If there's no /etc/rhsm folder just skip it
return
os.path.mkdir('/etc/rhsm/facts')
os.mkdir('/etc/rhsm/facts')
try:
with open('/etc/rhsm/facts/leapp.facts', 'w') as f:
json.dump(_flattened({
Expand Down

0 comments on commit 43ee16b

Please sign in to comment.