Skip to content

Conversation

@okurz
Copy link
Member

@okurz okurz commented Apr 29, 2025

No description provided.

@okurz

This comment was marked as resolved.

@okurz okurz force-pushed the feature/python_style branch from f3d986d to 92e7c02 Compare May 20, 2025 20:04
@okurz okurz force-pushed the feature/python_style branch 8 times, most recently from 8eec72a to 44256ed Compare May 20, 2025 20:41
This uses a custom CI image also providing ruff.
@okurz okurz force-pushed the feature/python_style branch from 44256ed to e9615e8 Compare May 20, 2025 20:42
@okurz
Copy link
Member Author

okurz commented May 20, 2025

All problems fixed now.

@okurz okurz marked this pull request as draft May 20, 2025 20:44
@okurz okurz marked this pull request as ready for review May 20, 2025 20:44
join(self.url, "index.php"),
params=params
)
params = "&".join("%s=%s" % (k, v) for k, v in search_payload.items())
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need this with requests? I am pretty sure passing the search_payload in the params should work out

Copy link
Member Author

Choose a reason for hiding this comment

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

Please only comment on the changes made in this PR which is only adjusting the style with ruff. I didn't even read the changed code in detail.

elif status >= 300:
raise Exception(f"Racktables returned statuscode {status} while trying to access {req.request.url}. Manual investigation needed.")
raise Exception(
f"Racktables returned statuscode {status} while trying to access {req.request.url}. Manual investigation needed."
Copy link
Contributor

Choose a reason for hiding this comment

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

just for clarity. it meant to be statuscode or status code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 33 to 36
try:
print(obj.fqdn, flush=True)
except:
except Exception:
print(obj.common_name, flush=True)
Copy link
Contributor

@d3flex d3flex May 21, 2025

Choose a reason for hiding this comment

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

what Exception is expected here? likely that obj is not defined or something. but it looks to me that the try should enclose the

url_path = result_obj.find("a")["href"]
obj = RacktablesObject(rt)
obj.from_path(url_path)

and not the print. wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

import json
import os.path
import sys
import re
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not related to the style I guess. Maybe a separate commit?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is related to style changes by removing unused changes. I only applied changes suggested by ruff

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically @b10n1k is correct. This is not a style change. I assume ruff is not just about coding style and complains about all sorts of "problems".

Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

This is technically not just about style changes.

@mergify mergify bot merged commit 0d1485d into os-autoinst:master May 21, 2025
4 checks passed
@okurz okurz deleted the feature/python_style branch May 21, 2025 08:46
@perlpunk
Copy link
Contributor

This is not available in leap 15.6, which is unfortunate, since it breaks OBS checks right now.
Also you never added it to the dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants