#1374 honor mock.package_manager tag setting in mock-config cli
Merged 3 years ago by mikem. Opened 3 years ago by mikem.

@@ -987,6 +987,14 @@ 

          name = options.name

      else:

          name = "%(tag_name)s-repo_%(repoid)s" % opts

+ 

+     event = None

+     if opts['repoid'] != 'latest':

+         event = session.repoInfo(opts['repoid'])['create_event']

+     buildcfg = session.getBuildConfig(opts['tag_name'], event=event)

+     if 'mock.package_manager' in buildcfg['extra']:

+         opts['package_manager'] = buildcfg['extra']['mock.package_manager']

+ 

      output = koji.genMockConfig(name, arch, **opts)

      if options.ofile:

          fo = open(options.ofile, 'w')

@@ -210,7 +210,7 @@ 

          self.assert_console_message(stdout, expected)

  

          # return build config

-         session.getBuildConfig.return_value = {'id': 301}

+         session.getBuildConfig.return_value = {'id': 301, 'extra': {}}

          expected = "Could not get a repo for tag: %(name)s\n" % tag

          self.assertEqual(1, anon_handle_mock_config(options, session, arguments))

          self.assert_console_message(stdout, expected)