Skip to content

[Feature]: Add charm_name on ApplicationStatus #888

@gabrielcocenza

Description

@gabrielcocenza

Description

We are using libjuju to access status of applications.
A simple juju status --format yaml gives this kind of output:

applications:
  keystone:
    charm: keystone
    series: focal
    os: ubuntu
    charm-origin: charmhub
    charm-name: keystone
    charm-rev: 636
    charm-channel: victoria/stable
    exposed: false
....

Using libjuju gives a ApplicationStatus object containing the following fields:

{
   "base":"<class""juju.client._definitions.Base"">("{
      "channel":"20.04/stable",
      "name":"ubuntu",
      "unknown_fields":{
         
      }
   }")",
   "can_upgrade_to":"",
   "charm":"ch:amd64/focal/keystone-636",
   "charm_channel":"victoria/stable",
   "charm_profile":"",
   "charm_version":"",

The way that we are getting the charm name is by applying a regex to get rid off charm origin, architecture and revision.
It seems to me that a new field in this class like charm_name is simple and can help us get the name directly without a workaround.

Urgency

It would save from a weird workaround

Code I'd Like to Run

$ python3 -m asyncio


>>> from juju.model import Model
>>> model = Model()
>>> await model.connect_current()
>>> status = await model.get_status()

>>> status.applications["keystone"].charm_name
keystone

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions