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

[6.13.z] Added possibility to search for debian errata #1189

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions airgun/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import re

from airgun.settings import Settings

settings = Settings()

ERRATA_REGEXP = re.compile(r'\w{3,4}[:-]\d{4}[-:]\d{1,4}')
5 changes: 2 additions & 3 deletions airgun/entities/errata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import re

from airgun import ERRATA_REGEXP
from airgun.entities.base import BaseEntity
from airgun.navigation import NavigateStep, navigator
from airgun.utils import retry_navigation
Expand Down Expand Up @@ -137,6 +136,6 @@ def step(self, *args, **kwargs):
repo = kwargs.get('repo')
self.parent.search(entity_name, applicable=applicable, installable=installable, repo=repo)
row_filter = {'title': entity_name}
if re.search(r'\w{3,4}[:-]\d{4}[-:]\d{4}', entity_name):
if ERRATA_REGEXP.search(entity_name):
row_filter = {'errata_id': entity_name}
self.parent.table.row(**row_filter)['Errata ID'].widget.click()
5 changes: 2 additions & 3 deletions airgun/views/errata.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import re

from widgetastic.widget import Checkbox, Text, View
from widgetastic_patternfly import BreadCrumb

from airgun import ERRATA_REGEXP
from airgun.views.common import BaseLoggedInView, SatTab, TaskDetailsView
from airgun.widgets import ItemsList, ReadOnlyEntry, SatSelect, SatTable, Search

Expand Down Expand Up @@ -40,7 +39,7 @@ def search(self, query, applicable=True, installable=False, repo=None):
if repo is not None:
self.repo_filter.fill(repo)

if re.search(r'\w{3,4}[:-]\d{4}[-:]\d{4}', query):
if ERRATA_REGEXP.search(query):
query = f'id = {query}'
self.searchbox.search(query)

Expand Down