Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Open
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
14 changes: 6 additions & 8 deletions cs_scanimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def __init__(

# Step 1: perform container tag to the registry corresponding to the cloud entered
def container_tag(self):
local_tag = "%s:%s" % (self.repo, self.tag)
url_tag = "%s/%s" % (self.server_domain, self.repo)
local_tag = f"{self.repo}:{self.tag}"
url_tag = f"{self.server_domain}/{self.repo}"

container_image = "".join(
(
Expand Down Expand Up @@ -121,7 +121,7 @@ def container_login(self):
# Step 3: perform container push using the repo and tag supplied
@retry(TimeoutError, tries=5, delay=5)
def container_push(self):
image_str = "%s/%s:%s" % (self.server_domain, self.repo, self.tag)
image_str = f"{self.server_domain}/{self.repo}:{self.tag}"
log.info("Performing container push to %s", image_str)

try:
Expand All @@ -145,9 +145,7 @@ def container_push(self):

if "status" in line and line["status"] == "Pushing":
print(
"Pushing {}".format(
[line.get(key) for key in ["progress", "progressDetails"]]
),
f"Pushing {[line.get(key) for key in ["progress", "progressDetails"]]}",
end="\r",
)
elif "status" in line:
Expand Down Expand Up @@ -335,7 +333,7 @@ def __init__(self, status):
self.status = status

def __str__(self):
return "APIError: status={}".format(self.status)
return f"APIError: status={self.status}"


class RetryExhaustedError(Exception):
Expand Down Expand Up @@ -539,7 +537,7 @@ def main(): # pylint:disable=R0915
log.info("Using %s container runtime", runtime)

if not skip_push:
useragent = "%s/%s" % (useragent, VERSION)
useragent = f"{useragent}/{VERSION}"
scan_image = ScanImage(
client_id, client_secret, repo, tag, client, runtime, cloud
)
Expand Down