149792c
From 1da1afda045ac7eda3f32fe6c7cc0385c64849d8 Mon Sep 17 00:00:00 2001
149792c
From: Randy Barlow <randy@electronsweatshop.com>
149792c
Date: Wed, 26 Sep 2018 19:42:53 -0400
149792c
Subject: [PATCH 1/2] Explicitly name the skopeo-lite src/dest_creds
149792c
 parameters.
149792c
149792c
The bodhi-skopeo-lite copy command accepts the source and
149792c
destination credentials via two different long-form (i.e., --)
149792c
flags. Click 6.0 named the resulting parameter by the second name,
149792c
and Click 7.0 names them by the first. This commit names the
149792c
parameter that click should use explicitly so that both flags can
149792c
work with both Click 6 and 7.
149792c
149792c
re #2621
149792c
149792c
Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
149792c
---
149792c
 bodhi/server/scripts/skopeo_lite.py | 11 ++++++-----
149792c
 1 file changed, 6 insertions(+), 5 deletions(-)
149792c
149792c
diff --git a/bodhi/server/scripts/skopeo_lite.py b/bodhi/server/scripts/skopeo_lite.py
149792c
index df0db013..0e752512 100644
149792c
--- a/bodhi/server/scripts/skopeo_lite.py
149792c
+++ b/bodhi/server/scripts/skopeo_lite.py
149792c
@@ -738,7 +738,7 @@ class Copier(object):
149792c
 
149792c
 
149792c
 @main.command()
149792c
-@click.option('--src-creds', '--screds', metavar='USERNAME[:PASSWORD]',
149792c
+@click.option('--src-creds', '--screds', 'src_creds', metavar='USERNAME[:PASSWORD]',
149792c
               help='Use USERNAME[:PASSWORD] for accessing the source registry')
149792c
 @click.option('--src-tls-verify', type=bool, default=True,
149792c
               help=('require HTTPS and verify certificates when talking to the '
149792c
@@ -746,7 +746,7 @@ class Copier(object):
149792c
 @click.option('--src-cert-dir', metavar='PATH',
149792c
               help=('use certificates at PATH (*.crt, *.cert, *.key) to connect to the '
149792c
                     'source registry'))
149792c
-@click.option('--dest-creds', '--dcreds', metavar='USERNAME[:PASSWORD]',
149792c
+@click.option('--dest-creds', '--dcreds', 'dest_creds', metavar='USERNAME[:PASSWORD]',
149792c
               help='Use USERNAME[:PASSWORD] for accessing the destination registry')
149792c
 @click.option('--dest-tls-verify', type=bool, default=True,
149792c
               help=('require HTTPS and verify certificates when talking to the '
149792c
@@ -756,10 +756,11 @@ class Copier(object):
149792c
                     'destination registry'))
149792c
 @click.argument('src', metavar='SOURCE-IMAGE-NAME')
149792c
 @click.argument('dest', metavar='DEST-IMAGE-NAME')
149792c
-def copy(src, dest, screds, src_tls_verify, src_cert_dir, dcreds, dest_tls_verify, dest_cert_dir):
149792c
+def copy(src, dest, src_creds, src_tls_verify, src_cert_dir, dest_creds, dest_tls_verify,
149792c
+         dest_cert_dir):
149792c
     """Copy an image from one location to another."""
149792c
-    src = parse_spec(src, screds, src_tls_verify, src_cert_dir)
149792c
-    dest = parse_spec(dest, dcreds, dest_tls_verify, dest_cert_dir)
149792c
+    src = parse_spec(src, src_creds, src_tls_verify, src_cert_dir)
149792c
+    dest = parse_spec(dest, dest_creds, dest_tls_verify, dest_cert_dir)
149792c
 
149792c
     if src.registry != dest.registry:
149792c
         tempdir = tempfile.mkdtemp()
149792c
-- 
149792c
2.19.1
149792c