Base

Python objects

Define Bodhi’s base classes for its message schemas.

Each message is defined as a Python class. For details, see fedora-messaging documentation on messages.

class bodhi.messages.schemas.base.BodhiMessage(body=None, headers=None, topic=None, properties=None, severity=None)[source]

Bases: fedora_messaging.message.Message

A base class for Bodhi messages.

agent

Return the agent’s username for this message.

Returns:The agent’s username, or None if the body has no agent key.
agent_avatar

Return a URL to the avatar of the user who caused the action.

Returns:The URL to the user’s avatar, or None if username is None.
app_icon

Return a URL that points to the application’s icon.

This is used when displaying the message to users.

Returns:A URL for Bodhi’s app icon.
containers

List of containers affected by the action that generated this message.

Returns:A list of affected container names.
flatpaks

List of flatpaks affected by the action that generated this message.

Returns:A list of affected flatpaks names.
modules

List of modules affected by the action that generated this message.

Returns:A list of affected module names.
usernames

List of users affected by the action that generated this message.

Returns:A list of affected usernames.
class bodhi.messages.schemas.base.BuildV1[source]

Bases: tuple

A model for referencing a Build.

nvr

The koji id of the build.

__annotations__ = {'nvr': <class 'str'>}
__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, nvr: str)

Create new instance of BuildV1(nvr,)

__repr__()

Return a nicely formatted representation string

__slots__ = ()
nvr

Alias for field number 0

package

Return the name of the package that this build is associated with.

static schema() → dict[source]

Return a schema snippet for a Build.

class bodhi.messages.schemas.base.UpdateV1[source]

Bases: tuple

A model for referencing an Update object.

alias

The alias of the update.

builds

A list of builds associated with the update.

submitter

The id of the user who submitted the update.

__annotations__ = {'alias': <class 'str'>, 'builds': typing.Iterable[bodhi.messages.schemas.base.BuildV1], 'request': typing.Union[NoneType, str], 'status': <class 'str'>, 'user': ForwardRef('UserV1')}
__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, alias: str, builds: Iterable[bodhi.messages.schemas.base.BuildV1], user: UserV1, status: str, request: Union[NoneType, str])

Create new instance of UpdateV1(alias, builds, user, status, request)

__repr__()

Return a nicely formatted representation string

__slots__ = ()
alias

Alias for field number 0

builds

Alias for field number 1

packages

Return a list of package names included in this update.

request

Alias for field number 4

static schema() → dict[source]

Return a schema snippet for an Update.

status

Alias for field number 3

user

Alias for field number 2

class bodhi.messages.schemas.base.UserV1[source]

Bases: tuple

A model for referencing a User object.

name

The User’s account name

__annotations__ = {'name': <class 'str'>}
__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, name: str)

Create new instance of UserV1(name,)

__repr__()

Return a nicely formatted representation string

__slots__ = ()
name

Alias for field number 0

static schema() → dict[source]

Return a schema snippet for a User.