From df61f5dec44babc0837256e423c12703b7cf080d Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Jul 10 2020 09:21:46 +0000 Subject: cli clone-tag - get srctag info with event So that tag config and extra honor `event` for clone-tag cmd fixes: #2101 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 2d5699a..15114e9 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -3410,7 +3410,7 @@ def handle_clone_tag(goptions, session, args): print(_("Cloning at event %(id)i (%(timestr)s)") % event) # store tags. - srctag = session.getTag(args[0]) + srctag = session.getTag(args[0], event=event.get('id')) dsttag = session.getTag(args[1]) if not srctag: parser.error(_("Unknown src-tag: %s" % args[0])) diff --git a/tests/test_cli/test_clone_tag.py b/tests/test_cli/test_clone_tag.py index eaa3e25..3e457a3 100644 --- a/tests/test_cli/test_clone_tag.py +++ b/tests/test_cli/test_clone_tag.py @@ -211,7 +211,7 @@ clone-tag will create the destination tag if it does not already exist handle_clone_tag(self.options, self.session, args) self.activate_session.assert_called_once() self.session.assert_has_calls([call.hasPerm('admin'), - call.getTag('src-tag'), + call.getTag('src-tag', event=None), call.getTag('dst-tag'), call.createTag('dst-tag', arches='arch1 arch2', @@ -485,7 +485,7 @@ List of changes: handle_clone_tag(self.options, self.session, args) self.activate_session.assert_called_once() self.session.assert_has_calls([call.hasPerm('admin'), - call.getTag('src-tag'), + call.getTag('src-tag', event=None), call.getTag('dst-tag'), call.listPackages(event=None, inherited=True,