-
Notifications
You must be signed in to change notification settings - Fork 146
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
setuptargetrepos actor code cleanup #301
setuptargetrepos actor code cleanup #301
Conversation
67e19f2
to
0e3c4c6
Compare
0e3c4c6
to
09b1c2a
Compare
09b1c2a
to
07bcbbe
Compare
07bcbbe
to
d6f3a5a
Compare
3e6f9f7
to
3b0f280
Compare
@asilveir, ready for re-review. |
leapp-ci build |
repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py
Show resolved
Hide resolved
3b0f280
to
e804a95
Compare
e804a95
to
b0b125e
Compare
Rebased and conflicts resolved. |
Tested and working. |
@@ -6,6 +6,7 @@ class RepositoriesSetupTasks(Model): | |||
""" | |||
Information about repositories that must be managed in order to complete upgrade process. | |||
|
|||
!!! THIS MODEL IS OBSOLETE. Use for example CustomTargetRepositories instead. !!! |
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.
I do not like to see the model is kind of obsoleted. I can imagine in future that based on checks, there will be case a specific repository needs to be enabled / disabled (talking about RHEL repos).
I am fun of Tasks suffix as this is kind of self explaining name we could use across many problems we would like to handle on one place. But the approach is questionable. Let's see what will be the way in future.
|
||
enabled_repos = set() | ||
def process(self): | ||
self.get_custom_repos() |
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.
Actually, it returns now rhel repositories. not custom:
p self.custom_repos
[<leapp.models.targetrepositories.CustomTargetRepository object at 0x7f115f1ed3d0>, <leapp.models.targetrepositories.CustomTargetRepository object at 0x7f115f1ed410>, <leapp.models.targetrepositories.CustomTargetRepository object at 0x7f115f1ed450>]
(Pdb) p self.custom_repos[0].name
None
(Pdb) p self.custom_repos[0].baseurl
None
(Pdb) p self.custom_repos[0].enabled
True
(Pdb) p self.custom_repos[0].repoid
u'rhel-8-for-x86_64-baseos-rpms'
(Pdb) p self.custom_repos[1].repoid
u'codeready-builder-for-rhel-8-x86_64-rpms'
(Pdb) p self.custom_repos[2].repoid
u'rhel-8-for-x86_64-appstream-rpms'
...
Expected only two customrepos (produced by custom actor) with APPSTREAM
and BASEOS
names.
@@ -406,4 +407,4 @@ def produce_messages(tasks): | |||
to_remove=to_remove_pkgs)) | |||
|
|||
if to_enable_repos: | |||
api.produce(RepositoriesSetupTasks(to_enable=to_enable_repos)) | |||
api.produce(CustomTargetRepositories(repos=[CustomTargetRepository(repoid=repo) for repo in to_enable_repos])) |
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.
that's the thing. You are presenting RH repos as custom which is wrong. You are changing here the meaning of CustomTargetRepositories model at all. (this is not the only issue in the PR as original msgs CustomTargetRepository messages are not processed.)
This reverts commit 47188e3. The commit brings several issues and I do not have power to fix it now correctly. I am reverting so it can be fixed properly in future without blocking the others now.
This reverts commit 47188e3. The commit brings several issues and I do not have power to fix it now correctly. I am reverting so it can be fixed properly in future without blocking the others now.
To changelog:
Remove RepositoriesSetupTasks which was kinda duplicate to the CustomTargetRepository.
Resolves #233.