From 83da1dfdf2cac60d8dd54a9d6b726d8a09e1ca00 Mon Sep 17 00:00:00 2001 From: Janine Olear Date: Tue, 15 Nov 2022 10:02:37 +0100 Subject: [PATCH] fix linting Signed-off-by: Janine Olear --- src/rhelocator/update_images/gcp.py | 12 +++++------- tests/update_images/test_gcp.py | 6 ++++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/rhelocator/update_images/gcp.py b/src/rhelocator/update_images/gcp.py index 9173b7e8..d19ca6b8 100644 --- a/src/rhelocator/update_images/gcp.py +++ b/src/rhelocator/update_images/gcp.py @@ -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 @@ -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, diff --git a/tests/update_images/test_gcp.py b/tests/update_images/test_gcp.py index cf044bfd..23b0f76c 100644 --- a/tests/update_images/test_gcp.py +++ b/tests/update_images/test_gcp.py @@ -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", @@ -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: