revert config and add repo name check

This commit is contained in:
Louis Abel 2022-07-06 23:56:19 -07:00
parent e9e37384ae
commit 8f9f2646b7
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36

View File

@ -100,6 +100,12 @@ class RepoSync:
self.gpgkey = gpgkey self.gpgkey = gpgkey
self.checksum = rlvars['checksum'] self.checksum = rlvars['checksum']
# The repo name should be valid
if self.repo is not None:
if self.repo not in self.repos:
self.log.error(Color.FAIL + 'Invalid repository: ' + self.repo)
raise SystemExit()
self.compose_id = '{}-{}-{}'.format( self.compose_id = '{}-{}-{}'.format(
config['shortname'], config['shortname'],
rlvars['revision'], rlvars['revision'],
@ -661,7 +667,7 @@ class RepoSync:
""" """
fname = os.path.join( fname = os.path.join(
dest_path, dest_path,
"{}-config.repo".format(self.major_version) "{}-{}-config.repo".format(self.shortname, self.major_version)
) )
self.log.info('Generating the repo configuration: %s' % fname) self.log.info('Generating the repo configuration: %s' % fname)