Make sure all required yum repo options are set

enabled and gpgcheck parameters has to be set for any
configured yum repository
This commit is contained in:
Marcus Schäfer 2017-06-01 15:54:16 +02:00
parent 9ccf079885
commit d4b8a030d6
No known key found for this signature in database
GPG Key ID: AD11DD02B44996EF
2 changed files with 8 additions and 0 deletions

View File

@ -153,6 +153,12 @@ class RepositoryYum(RepositoryBase):
repo_config.set(
name, 'baseurl', uri
)
repo_config.set(
name, 'enabled', '1'
)
repo_config.set(
name, 'gpgcheck', self.gpg_check
)
if prio:
repo_config.set(
name, 'priority', format(prio)

View File

@ -108,6 +108,8 @@ class TestRepositoryYum(object):
assert repo_config.set.call_args_list == [
call('foo', 'name', 'foo'),
call('foo', 'baseurl', 'file://kiwi_iso_mount/uri'),
call('foo', 'enabled', '1'),
call('foo', 'gpgcheck', '0'),
call('foo', 'priority', '42')
]
mock_open.assert_called_once_with(