#2442 cli: don't require --config in clone-tag
Merged 3 years ago by tkopecek. Opened 3 years ago by tkopecek.
tkopecek/koji issue2012  into  master

file modified
+8 -7
@@ -3421,15 +3421,16 @@ 

      chggrplist = []

      # case of brand new dst-tag.

      if not dsttag:

-         if not options.config:

-             parser.error(_('Cannot create tag without specifying --config'))

          # create a new tag, copy srctag header.

          if not options.test:

-             session.createTag(args[1], parent=None, arches=srctag['arches'],

-                               perm=srctag['perm_id'],

-                               locked=srctag['locked'],

-                               maven_support=srctag['maven_support'],

-                               maven_include_all=srctag['maven_include_all'])

+             if options.config:

+                 session.createTag(args[1], parent=None, arches=srctag['arches'],

+                                   perm=srctag['perm_id'],

+                                   locked=srctag['locked'],

+                                   maven_support=srctag['maven_support'],

+                                   maven_include_all=srctag['maven_include_all'])

+             else:

+                 session.createTag(args[1], parent=None)

              # store the new tag, need its assigned id.

              newtag = session.getTag(args[1], strict=True)

          # get pkglist of src-tag, including inherited packages.

@@ -121,23 +121,6 @@ 

          self.activate_session.getTag.has_called([mock.call('src-tag'),

                                                   mock.call('dst-tag')])

  

-     def test_handle_clone_tag_no_config(self):

-         args = ['src-tag', 'dst-tag']

-         self.session.getTag.side_effect = [{'id': 1,

-                                             'locked': False},

-                                            None]

-         self.assert_system_exit(

-             handle_clone_tag,

-             self.options,

-             self.session,

-             args,

-             stderr=self.format_error_message(

-                 "Cannot create tag without specifying --config"),

-             activate_session=None)

-         self.activate_session.assert_called_once()

-         self.activate_session.getTag.has_called([mock.call('src-tag'),

-                                                  mock.call('dst-tag')])

- 

      @mock.patch('sys.stdout', new_callable=six.StringIO)

      def test_handle_clone_tag_new_dsttag(self, stdout):

          args = ['src-tag', 'dst-tag', '--all', '-v']

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

3 years ago

rebased onto 64c4c5c

3 years ago

This is actually a fix for #2012. We will have other PRs for the issues listed in https://pagure.io/koji/issue/2012#comment-640529

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

3 years ago

Commit 3067461 fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago