Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#17324)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gaurav Talreja <[email protected]>
Co-authored-by: Ondřej Gajdušek <[email protected]>
  • Loading branch information
3 people authored Jan 17, 2025
1 parent 68c7588 commit 9168b12
Show file tree
Hide file tree
Showing 66 changed files with 576 additions and 592 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: check-yaml
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -28,6 +28,6 @@ repos:
types: [text]
require_serial: true
- repo: https://github.com/gitleaks/gitleaks
rev: v8.22.1
rev: v8.23.1
hooks:
- id: gitleaks
3 changes: 1 addition & 2 deletions conf/dynaconf_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def post(settings):
except FileNotFoundError:
# no settings cache file exists
logger.warning(
f'The [{settings_cache_path}] cache file was not found.'
'Config will be fetched now.'
f'The [{settings_cache_path}] cache file was not found.Config will be fetched now.'
)
data = get_repos_config(settings)
write_cache(settings_cache_path, data)
Expand Down
2 changes: 1 addition & 1 deletion pytest_fixtures/component/http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setup_http_proxy_global(request, target_sat):
if request.param:
hostname = settings.http_proxy.auth_proxy_url[7:]
general_proxy = (
f'http://{settings.http_proxy.username}:' f'{settings.http_proxy.password}@{hostname}'
f'http://{settings.http_proxy.username}:{settings.http_proxy.password}@{hostname}'
)
else:
general_proxy = settings.http_proxy.un_auth_proxy_url
Expand Down
12 changes: 6 additions & 6 deletions pytest_fixtures/core/contenthosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ def module_container_contenthost(request, module_target_sat, module_org, module_
with Broker(**host_conf(request), host_class=ContentHost) as host:
host.register_to_cdn()
for client in constants.CONTAINER_CLIENTS:
assert (
host.execute(f'yum -y install {client}').status == 0
), f'{client} installation failed'
assert (
host.execute('systemctl enable --now podman').status == 0
), 'Start of podman service failed'
assert host.execute(f'yum -y install {client}').status == 0, (
f'{client} installation failed'
)
assert host.execute('systemctl enable --now podman').status == 0, (
'Start of podman service failed'
)
host.unregister()
assert (
host.register(module_org, None, module_activation_key.name, module_target_sat).status
Expand Down
3 changes: 1 addition & 2 deletions pytest_fixtures/core/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def pytest_report_header(config):
scope = ''
storage = settings.shared_function.storage
messages.append(
f'shared_function enabled - {shared_function_enabled} - '
f'scope: {scope} - storage: {storage}'
f'shared_function enabled - {shared_function_enabled} - scope: {scope} - storage: {storage}'
)
return messages

Expand Down
4 changes: 1 addition & 3 deletions pytest_fixtures/core/xdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def align_to_satellite(request, worker_id, satellite_factory):
configure_nailgun()
yield
if on_demand_sat and settings.server.auto_checkin:
logger.info(
f'{worker_id=}: Checking in on-demand Satellite ' f'{on_demand_sat.hostname}'
)
logger.info(f'{worker_id=}: Checking in on-demand Satellite {on_demand_sat.hostname}')
on_demand_sat.teardown()
Broker(hosts=[on_demand_sat]).checkin()
9 changes: 4 additions & 5 deletions robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,7 @@
'rhscl7': {
'id': 'rhel-server-rhscl-7-rpms',
'name': (
'Red Hat Software Collections RPMs for Red Hat Enterprise'
' Linux 7 Server x86_64 7Server'
'Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_64 7Server'
),
'releasever': '7Server',
'version': '7',
Expand Down Expand Up @@ -1558,7 +1557,8 @@
'create_hosts',
'edit_hosts',
'destroy_hosts',
'build_hosts' 'power_hosts',
'build_hosts',
'power_hosts',
'console_hosts',
'ipmi_boot_hosts',
'forget_status_hosts',
Expand Down Expand Up @@ -1920,8 +1920,7 @@
FOREMAN_TEMPLATE_IMPORT_API_URL = 'http://api.github.com/repos/SatelliteQE/foreman_templates'

FOREMAN_TEMPLATE_TEST_TEMPLATE = (
'https://raw.githubusercontent.com/SatelliteQE/foreman_templates/example/'
'example_template.erb'
'https://raw.githubusercontent.com/SatelliteQE/foreman_templates/example/example_template.erb'
)

FOREMAN_TEMPLATE_ROOT_DIR = '/usr/share/foreman_templates'
Expand Down
2 changes: 1 addition & 1 deletion robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def create_custom_repos(self, **kwargs):
"""
for name, url in kwargs.items():
content = f'[{name}]\n' f'name={name}\n' f'baseurl={url}\n' 'enabled=1\n' 'gpgcheck=0'
content = f'[{name}]\nname={name}\nbaseurl={url}\nenabled=1\ngpgcheck=0'
self.execute(f'echo "{content}" > /etc/yum.repos.d/{name}.repo')

def get_base_url_for_older_rhel_minor(self):
Expand Down
24 changes: 12 additions & 12 deletions tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,9 +1556,9 @@ def test_complete_sync_fixes_metadata(
host = module_target_sat.api.Host().search(
query={'search': f'name="{rhel_contenthost.hostname}"'}
)[0]
assert (
nc.id == host.content_facet_attributes['content_source_id']
), 'Expected to see the Capsule as the content source'
assert nc.id == host.content_facet_attributes['content_source_id'], (
'Expected to see the Capsule as the content source'
)

result = rhel_contenthost.execute('dnf repolist')
assert result.status == 0
Expand Down Expand Up @@ -1757,9 +1757,9 @@ def test_positive_content_counts_for_mixed_cv(
# Every "environment repo" (the one promoted to an LCE and synced to the Capsule)
# is shown in the content_counts, so we get N-times more for every shared lce.
shared_lces = {env.id for env in cvv.environment} & {env['id'] for env in capsule_lces}
assert len(caps_counts['repositories']) == len(cvv.repository) * len(
shared_lces
), 'Repositories count does not match.'
assert len(caps_counts['repositories']) == len(cvv.repository) * len(shared_lces), (
'Repositories count does not match.'
)

# Read the environment repos from Satellite side and compare the counts with Capsule.
sat_repos = [
Expand Down Expand Up @@ -1812,9 +1812,9 @@ def test_positive_content_counts_blank_update(
assert 'success' in task['result']

counts = module_capsule_configured.nailgun_capsule.content_counts()
assert (
counts is None or len(counts['content_view_versions']) == 0
), f"No content counts expected, but got:\n{counts['content_view_versions']}."
assert counts is None or len(counts['content_view_versions']) == 0, (
f"No content counts expected, but got:\n{counts['content_view_versions']}."
)

@pytest.mark.parametrize('module_autosync_setting', [True], indirect=True)
@pytest.mark.parametrize(
Expand Down Expand Up @@ -2017,9 +2017,9 @@ def test_positive_reclaim_space(
# Trigger the reclaim space task via API, check it succeeds
task = module_capsule_configured.nailgun_capsule.content_reclaim_space()
assert task, 'No task was created for reclaim space.'
assert (
'Actions::Pulp3::CapsuleContent::ReclaimSpace' in task['label']
), 'Unexpected task triggered'
assert 'Actions::Pulp3::CapsuleContent::ReclaimSpace' in task['label'], (
'Unexpected task triggered'
)
assert 'success' in task['result'], 'Reclaim task did not succeed'

# Check the apidoc references the correct endpoint
Expand Down
3 changes: 1 addition & 2 deletions tests/foreman/api/test_discoveredhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def _assert_discovered_host(host, channel=None, user_config=None):
try:
facts_fdi = _wait_for_log(
channel,
f'\\[I\\|app\\|[a-z0-9]+\\] Started POST '
f'"/api/v2/discovered_hosts/facts" for {fdi_ip}',
f'\\[I\\|app\\|[a-z0-9]+\\] Started POST "/api/v2/discovered_hosts/facts" for {fdi_ip}',
timeout=60,
)
except TimedOutError as err:
Expand Down
Loading

0 comments on commit 9168b12

Please sign in to comment.