Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
Signed-off-by: Janine Olear <pninak@web.de>
  • Loading branch information
miyunari committed Nov 15, 2022
1 parent 34740ae commit 83da1df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/rhelocator/update_images/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def parse_image_version_from_name(image_name: str) -> str:
rhel-7-9
"""
res = image_name.split("-", 3)
return res[0]+"-"+res[1]+"-"+res[2]
return res[0] + "-" + res[1] + "-" + res[2]


def format_all_images() -> object:
"""Retrieve all google images and return a simplified data
representation.
"""Retrieve all google images and return a simplified data representation.
Returns:
JSON like structure containting a list of streamlined image
Expand Down Expand Up @@ -107,11 +107,9 @@ def format_image(image: dict[str, str]) -> dict[str, str]:
date = image["creation_timestamp"]
version = parse_image_version_from_name(image["name"])


name = f"RHEL {version} {arch}"
selflink = (
f"https://console.cloud.google.com/compute/imagesDetail/projects/rhel-cloud/global/images/{image_id}"
)
selflink = "https://console.cloud.google.com/compute/imagesDetail/"
selflink += f"projects/rhel-cloud/global/images/{image_id}"

return {
"name": name,
Expand Down
6 changes: 4 additions & 2 deletions tests/update_images/test_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def test_parse_image_version_from_name():


def test_format_image():
"""Test transforming a single google image into a schmea approved format."""
"""Test transforming a single google image into a schmea approved
format."""
mocked_image = {
"id": "rhel-7-v20220719",
"architecture": "x86_64",
Expand All @@ -89,7 +90,8 @@ def test_format_image():


def test_format_all_images(mock_gcp_images):
"""Test transforming a list of google images into a schema approved format."""
"""Test transforming a list of google images into a schema approved
format."""
data = gcp.format_all_images()

try:
Expand Down

0 comments on commit 83da1df

Please sign in to comment.