Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messaging: Provide metadata for messages #504

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinzenz
Copy link
Member

@vinzenz vinzenz commented May 3, 2019

This patch introduces the necessities to provide message metadata.

The meta data can be useful to identify the time, phase, actor, topic
or hostname.

Example usage from an actor:

from leapp.libraries.stdlib import api
from leapp.models import MyModel

def needs_metadata():
    for model in api.consume(MyModel):
        md = model.message_metadata()
        if md and md.phase == 'facts':
            api.current_logger().info('Facts phase run at %s', md.timestamp)

Signed-off-by: Vinzenz Feenstra [email protected]

This patch introduces the necessities to provide message metadata.

The meta data can be useful to identify the time, phase, actor, topic
or hostname.

Example usage from an actor:
----------------------------
```
from leapp.libraries.stdlib import api
from leapp.models import MyModel

def needs_metadata():
    for model in api.consume(MyModel):
        md = model.message_metadata()
        if md and md.phase == 'facts':
            api.current_logger().info('Facts phase run at %s', md.timestamp)
```

Signed-off-by: Vinzenz Feenstra <[email protected]>
@vinzenz vinzenz force-pushed the provide_message_metadata branch from de2291b to 880d516 Compare May 3, 2019 11:08
@vinzenz vinzenz requested a review from a team May 3, 2019 11:16
@leapp-bot
Copy link
Collaborator

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines, pass tests and linter checks before it can be merged.

If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run unit tests and copr build
  • e2e tests to run unit tests, copr build and end-to-end tests (OAMG members only)
  • review please to notify leapp developers of review request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants