symlink functions

This commit is contained in:
Louis Abel 2022-06-16 13:18:18 -07:00
parent 613687c3c8
commit 84ac608967
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
2 changed files with 11 additions and 4 deletions

BIN
iso/py/.common.py.swp Normal file

Binary file not shown.

View File

@ -67,6 +67,7 @@ class RepoSync:
self.compose_base = config['compose_root'] + "/" + major
# Relevant major version items
self.shortname = config['shortname']
self.revision = rlvars['revision'] + "-" + rlvars['rclvl']
self.fullversion = rlvars['revision']
self.arches = rlvars['allowed_arches']
@ -190,7 +191,7 @@ class RepoSync:
if self.fullrun:
self.deploy_extra_files()
self.symlink_to_latest()
self.symlink_to_latest(generated_dir)
if self.repoclosure:
self.repoclosure_work(sync_root, work_root, log_root)
@ -525,7 +526,7 @@ class RepoSync:
return compose_base_dir
def symlink_to_latest(self):
def symlink_to_latest(self, generated_dir):
"""
Emulates pungi and symlinks latest-Rocky-X
@ -533,8 +534,14 @@ class RepoSync:
'latest' directory is what is rsynced on to staging after completion.
This link should not change often.
"""
try:
os.remove(self.compose_latest_dir)
except:
pass
self.log.info('Symlinking to latest-{}-{}...'.format(self.shortname, self.major_version))
os.symlink(generated_dir, self.compose_latest_dir)
def generate_conf(self, dest_path='/var/tmp') -> str:
"""
Generates the necessary repo conf file for the operation. This repo
@ -798,7 +805,7 @@ class RepoSync:
also deploys COMPOSE_ID and maybe in the future a metadata dir with a
bunch of compose-esque stuff.
"""
pass
self.log.info('Deploying extra files...')
class SigRepoSync:
"""