Skip to content

Fix 'str' object has no attribute 'dirname'#695

Merged
wolsen merged 1 commit into
juju:masterfrom
freyes:fix-dirname
Apr 3, 2026
Merged

Fix 'str' object has no attribute 'dirname'#695
wolsen merged 1 commit into
juju:masterfrom
freyes:fix-dirname

Conversation

@freyes

@freyes freyes commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

This stacktrace was found when trying to build the manila charm.

Traceback (most recent call last):
  File "/snap/charm/796/usr/local/bin/charm-build", line 33, in <module>
    sys.exit(load_entry_point('charm-tools==3.0.8.post7+g2463e7a', 'console_scripts', 'charm-build')())
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 1251, in main
    build()
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 854, in __call__
    self.generate()
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 792, in generate
    self.formulate_plan(layers)
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 598, in formulate_plan
    self.plan = self.plan_layers(layers, output_files)
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 430, in plan_layers
    wh_tactic.combine(existing_tactic)
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/tactics.py", line 1117, in combine
    self.read()
  File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/tactics.py", line 1194, in read
    src = path(self.entity.dirname()) / self.CONS_FILENAME
AttributeError: 'str' object has no attribute 'dirname'

Description of change

Checklist

  • Are all your commits [logically] grouped and squashed appropriately?
  • Does this patch have code coverage?
  • Does your code pass make test?

This stacktrace was found when trying to build the manila charm.

    Traceback (most recent call last):
      File "/snap/charm/796/usr/local/bin/charm-build", line 33, in <module>
        sys.exit(load_entry_point('charm-tools==3.0.8.post7+g2463e7a', 'console_scripts', 'charm-build')())
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 1251, in main
        build()
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 854, in __call__
        self.generate()
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 792, in generate
        self.formulate_plan(layers)
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 598, in formulate_plan
        self.plan = self.plan_layers(layers, output_files)
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/builder.py", line 430, in plan_layers
        wh_tactic.combine(existing_tactic)
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/tactics.py", line 1117, in combine
        self.read()
      File "/snap/charm/796/usr/local/lib/python3.10/dist-packages/charmtools/build/tactics.py", line 1194, in read
        src = path(self.entity.dirname()) / self.CONS_FILENAME
    AttributeError: 'str' object has no attribute 'dirname'

Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>
@freyes freyes requested a review from wolsen April 3, 2026 01:37
@wolsen wolsen merged commit 5ebfa3a into juju:master Apr 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants