Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Transport Prefixes #133

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
9 changes: 8 additions & 1 deletion podman_hpc/podman_hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,20 @@ def images(ctx, siteconf, image, podman_args, **site_opts):
@click.argument("podman_args", nargs=-1, type=click.UNPROCESSED)
@click.argument("image")
def pull(ctx, siteconf, image, podman_args, **site_opts):
"""Pulls an image to a local repository and makes a squashed copy."""
"""Pulls an image to a local repository and makes a squashed copy."""
Copy link
Member

Choose a reason for hiding this comment

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

Can you fix the trailing whitespaces?

cmd = [siteconf.podman_bin, "pull"]
cmd.extend(podman_args)
cmd.extend(siteconf.get_cmd_extensions("pull", site_opts))
cmd.append(image)
proc = Popen(cmd)
proc.communicate()

# Check for transport_prefix
if "://" in image:
transport_prefix, image = image.split("://", 1)
Copy link
Member

Choose a reason for hiding this comment

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

Since the prefix isn't used, maybe replace this with just

if "://" in image:
        image = image.split("://", 1)[0]

else:
Copy link
Member

Choose a reason for hiding this comment

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

You can drop the else section since we don't use the transport prefix

transport_prefix = None

if proc.returncode == 0:
sys.stdout.write(f"INFO: Migrating image to {siteconf.squash_dir}\n")
mu = MigrateUtils(conf=siteconf)
Expand Down