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

Duplicated lines from leapp.linter #316

Open
artmello opened this issue May 7, 2018 · 2 comments
Open

Duplicated lines from leapp.linter #316

artmello opened this issue May 7, 2018 · 2 comments
Labels

Comments

@artmello
Copy link
Contributor

artmello commented May 7, 2018

In a Fedora 28 machine, using Python 2.7.14, I create the following project:

(env) $ snactor new-project sandbox
New project sandbox has been created in /home/amello/red_hat/vms/leapp-centos/sandbox/sandbox
(env) $ cd sandbox/
(env) [sandbox]$ snactor new-tag Scan
New tag Scan has been created in /home/amello/red_hat/vms/leapp-centos/sandbox/sandbox/tags/scan.py
(env) [sandbox]$ snactor new-actor A
New actor A has been created at /home/amello/red_hat/vms/leapp-centos/sandbox/sandbox/actors/a/actor.py

This is the code of actor A, with field tags not being a tuple:

from leapp.actors import Actor
from leapp.tags import ScanTag


class A(Actor):
    name = 'a'
    description = 'Sample actor A.'
    consumes = ()
    produces = ()
    tags = (ScanTag)

    def process(self):
        self.log.info("Starting actor A")

When I try to run actor A, leapp.linter warns me multiple times about the same problem.

(env) [sandbox]$ snactor run A
2018-05-07 23:11:33.260 INFO     PID: 22995 leapp: Logging has been initialized
2018-05-07 23:11:33.270 INFO     PID: 22995 leapp.repository.sandbox: New repository 'sandbox' initialized at /home/amello/red_hat/vms/leapp-centos/sandbox/sandbox
2018-05-07 23:11:33.302 WARNING  PID: 22997 leapp.linter: Actor <class 'actor.A'> field tags should be a tuple of Tags
2018-05-07 23:11:33.314 WARNING  PID: 22997 leapp.linter: Actor <class 'actor.A'> field tags should be a tuple of Tags
2018-05-07 23:11:33.349 WARNING  PID: 23010 leapp.linter: Actor <class 'actor.A'> field tags should be a tuple of Tags
2018-05-07 23:11:33.360 INFO     PID: 23010 leapp.actors.a: Starting actor A
@artmello artmello added the bug label May 7, 2018
@vinzenz
Copy link
Member

vinzenz commented Jun 14, 2018

Attempted fix: abfe3fb

@vinzenz vinzenz closed this as completed Aug 28, 2018
@vojtechsokol
Copy link
Member

There are still duplicit lines from linter (not three same lines but only two, so there's a progress here):

$ snactor repo new NewRepo
New repository NewRepo has been created in /home/user/NewRepo
$ snactor new-tag NewTag
New tag NewTag has been created in /home/user/NewRepo/tags/newtag.py
$ snactor new-model NewModel
New model NewModel has been created in /home/user/NewRepo/models/newmodel.py
NewModel.topic = NewTopic
NewActor.consumes = (NewModel)
NewActor.tags = (NewTag)
$ snactor run NewActor
2018-11-13 21:58:19.668 INFO     PID: 3212 leapp: Logging has been initialized
2018-11-13 21:58:19.681 INFO     PID: 3212 leapp.repository.NewRepo: A new repository 'NewRepo' is initialized at /home/user/NewRepo
2018-11-13 21:58:19.700 WARNING  PID: 3217 leapp.linter: Actor <class 'actor.NewActor'> field tags should be a tuple of Tags
2018-11-13 21:58:19.710 WARNING  PID: 3217 leapp.linter: Actor <class 'actor.NewActor'> field consumes should be a tuple of Models
2018-11-13 21:58:19.737 WARNING  PID: 3233 leapp.linter: Actor <class 'actor.NewActor'> field tags should be a tuple of Tags
2018-11-13 21:58:19.748 WARNING  PID: 3233 leapp.linter: Actor <class 'actor.NewActor'> field consumes should be a tuple of Models
$ rpm -q snactor python2-leapp python2
snactor-0.3-1.devel.20181112.git.238.noarch
python2-leapp-0.3-1.devel.20181112.git.238.noarch
python2-2.7.13-17.fc27.x86_64

@vojtechsokol vojtechsokol reopened this Nov 13, 2018
MichalHe pushed a commit to MichalHe/leapp that referenced this issue Aug 12, 2021
- Add unit test
- Refactoring of actor, library and unit_test files
- Apply suggestions from code review

Signed-off-by: Fellipe Henrique <fpedrosa@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants