-
Notifications
You must be signed in to change notification settings - Fork 14
New augeas actor #68
base: master
Are you sure you want to change the base?
New augeas actor #68
Conversation
leapp-ci build |
2 similar comments
leapp-ci build |
leapp-ci build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should revisit the general design where to put it and how to use it. Most likely I can see the use case of moving augeasprivate to common/libraries as a public augeas library for all actors, and have a dedicated actor for the upgrade to produce configuration
If we want some additional things we would modify that actor and patches can be sent to that one.
repos/common/tags/scan.py
Outdated
@@ -0,0 +1,5 @@ | |||
from leapp.tags import Tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop this tag, and move the FactsPhaseTag form repos/upgrade/tags to repos/common/tags
produces = (AugeasOutput,) | ||
tags = (ScanTag,) | ||
|
||
def __init__(self, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless constructor, use process only
@@ -0,0 +1,2 @@ | |||
install-deps: | |||
yum -y install augeas python-augeas python2-augeas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies also the spec file needs to be updated to depend on those things
# self.consumed_msg = msg | ||
# self.log.info("Starting to process...") | ||
try: | ||
self.consumed_msg = self.consume(AugeasInput).next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- No sense to use member variables for this on self, there's no use for these
- Use next(self.consume(AugeasInput), None) which will give you None as a result if there's no message, that will help you to avoid having to process the input.
consumed_msg = next(self.consume(AugeasInput), None)
if consumed_msg:
...
self.consumed_msg = self.consume(AugeasInput).next() | ||
|
||
metadata = augeasprivate.process_augeas_data( | ||
self.consumed_msg, self.lenses_folder, self.augeas_tree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since, I already said that the constructor usage doesn't make sense, you can use the lenses_folder, and augeas_tree parts directly here.
CustomLensConfig( | ||
lens_name='httpd', | ||
directives=['ScriptAlias'], | ||
load_files=['/home/sokol/bench/950-augeas/httpd.conf'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard coded path to your home
), | ||
CustomLensConfig( | ||
lens_name='libvirtd', | ||
load_files=['/home/sokol/bench/950-augeas/libvirtd.conf'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
description = 'Actor scans config files using Augeas' | ||
consumes = (AugeasInput,) | ||
produces = (AugeasOutput,) | ||
tags = (ScanTag,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FactsPhaseTag
leapp-ci build |
leapp-ci build |
leapp-ci build |
No description provided.