Skip to content

Commit fc2a954

Browse files
committed
Add charm_name property to Application
Fixes #888
1 parent fabb5d5 commit fc2a954

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

juju/application.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,19 @@ async def run(self, command, timeout=None):
567567
units=[],
568568
)
569569

570+
@property
571+
def charm_name(self):
572+
"""Get the charm name of this application
573+
574+
:return str: The name of the charm
575+
"""
576+
return URL.parse(self.charm_url).name
577+
570578
@property
571579
def charm_url(self):
572-
"""Get the charm url for a given application
580+
"""Get the charm url for this application
573581
574-
:return string: The charm url for an application
582+
:return str: The charm url
575583
"""
576584
return self.safe_data['charm-url']
577585

0 commit comments

Comments
 (0)