Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

New augeas actor #68

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

New augeas actor #68

wants to merge 7 commits into from

Conversation

vojtechsokol
Copy link
Collaborator

No description provided.

@leapp-bot
Copy link
Collaborator

@leapp-bot
Copy link
Collaborator

@leapp-bot
Copy link
Collaborator

@leapp-bot
Copy link
Collaborator

@leapp-bot
Copy link
Collaborator

@vojtechsokol vojtechsokol removed the wip label Aug 19, 2018
@vojtechsokol vojtechsokol changed the title [WIP] New augeas actor New augeas actor Aug 19, 2018
@examon
Copy link
Collaborator

examon commented Aug 21, 2018

leapp-ci build

2 similar comments
@examon
Copy link
Collaborator

examon commented Aug 22, 2018

leapp-ci build

@vinzenz
Copy link
Collaborator

vinzenz commented Sep 3, 2018

leapp-ci build

@leapp-bot
Copy link
Collaborator

Copy link
Collaborator

@vinzenz vinzenz left a 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/actors/augeasconfig/actor.py Outdated Show resolved Hide resolved
@@ -0,0 +1,5 @@
from leapp.tags import Tag
Copy link
Collaborator

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):
Copy link
Collaborator

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
Copy link
Collaborator

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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. No sense to use member variables for this on self, there's no use for these
  2. 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
Copy link
Collaborator

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']
Copy link
Collaborator

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']
Copy link
Collaborator

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,)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FactsPhaseTag

repos/common/topics/systeminfo.py Outdated Show resolved Hide resolved
@examon
Copy link
Collaborator

examon commented Sep 10, 2018

leapp-ci build

@vojtechsokol
Copy link
Collaborator Author

leapp-ci build

@leapp-bot
Copy link
Collaborator

@leapp-bot
Copy link
Collaborator

@dirgim
Copy link

dirgim commented Nov 20, 2018

leapp-ci build

@leapp-bot
Copy link
Collaborator

@leapp-bot
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

5 participants