cengn reference removal - debian

mirror.starlingx.cengn.ca no longer exists. CENGN is kindly forwarding
requests to the new location mirror.starlingx.windriver.com for now, but
that will only last a few months. We need to replace all the references
with the new URL.

I will also remove as many 'cengn' references as possible, replacing
them
with 'stx_mirror'

Partial-Bug: 2033555
Signed-off-by: Scott Little <scott.little@windriver.com>
Change-Id: Icea255bcf628d0535991156a729ef21421646bfc
This commit is contained in:
Scott Little 2023-09-12 16:01:10 -04:00 committed by Davlet Panech
parent 9252fcc9c6
commit fee99ba459
4 changed files with 52 additions and 14 deletions

View File

@ -87,8 +87,36 @@ class HandleControlTask:
proxyport = self.config.get('project', 'proxyport') proxyport = self.config.get('project', 'proxyport')
buildbranch = self.config.get('project', 'buildbranch') buildbranch = self.config.get('project', 'buildbranch')
manifest = self.config.get('project', 'manifest') manifest = self.config.get('project', 'manifest')
stx_mirror_url = self.config.get('repomgr', 'stx_mirror_url') # The cengn references below are obsolete, and are retained for
stx_mirror_strategy = self.config.get('repomgr', 'stx_mirror_strategy') # backward compatibility with preexisting build environmnets.
# Please use stx_mirror versions instead.
cengnurl = None
try:
stx_mirror_url = self.config.get('repomgr', 'stx_mirror_url')
except Exception:
# second chance using old cengnurl
try:
cengnurl = self.config.get('repomgr', 'cengnurl')
stx_mirror_url = cengnurl
except Exception:
# Fail on stx_mirror_url without catching the error this time
stx_mirror_url = self.config.get('repomgr', 'stx_mirror_url')
cengnstrategy = None
try:
stx_mirror_strategy = self.config.get('repomgr', 'stx_mirror_strategy')
except Exception:
try:
# second chance using old cengnstrategy
cengnstrategy = self.config.get('repomgr', 'cengnstrategy')
stx_mirror_strategy = cengnstrategy
if cengnstrategy == 'cengn':
stx_mirror_strategy = 'stx_mirror'
if cengnstrategy == 'cengn_first':
stx_mirror_strategy = 'stx_mirror_first'
except Exception:
# Fail on stx_mirror_strategy without catching the error this time
stx_mirror_strategy = self.config.get('repomgr', 'stx_mirror_strategy')
sourceslist = self.config.get('repomgr', 'sourceslist') sourceslist = self.config.get('repomgr', 'sourceslist')
deblist = self.config.get('repomgr', 'deblist') deblist = self.config.get('repomgr', 'deblist')
dsclist = self.config.get('repomgr', 'dsclist') dsclist = self.config.get('repomgr', 'dsclist')
@ -171,6 +199,11 @@ stx-pkgbuilder/configmap/')
line = line.replace("@BUILDBRANCH@", buildbranch) line = line.replace("@BUILDBRANCH@", buildbranch)
line = line.replace("@MANIFEST@", manifest) line = line.replace("@MANIFEST@", manifest)
line = line.replace("@HOSTUSERNAME@", hostusername) line = line.replace("@HOSTUSERNAME@", hostusername)
# The cengn references below are obsolete, and are retained for
# backward compatibility with preexisting build environmnets.
# Please use stx_mirror versions instead.
line = line.replace("@CENGNURL@", stx_mirror_url)
line = line.replace("@CENGNSTRATEGY@", stx_mirror_strategy)
line = line.replace("@STX_MIRROR_URL@", stx_mirror_url) line = line.replace("@STX_MIRROR_URL@", stx_mirror_url)
line = line.replace("@STX_MIRROR_STRATEGY@", stx_mirror_strategy) line = line.replace("@STX_MIRROR_STRATEGY@", stx_mirror_strategy)
line = line.replace("@OSTREE_OSNAME@", ostree_osname) line = line.replace("@OSTREE_OSNAME@", ostree_osname)

View File

@ -36,6 +36,10 @@ export MANIFEST=@MANIFEST@
export HOSTUSERNAME=@HOSTUSERNAME@ export HOSTUSERNAME=@HOSTUSERNAME@
export CENGNURL=@CENGNURL@
# CENGN_STRATEGY value: [ cengn|cengn_first|upstream|upstream_first ]
export CENGN_STRATEGY=@CENGNSTRATEGY@
export STX_MIRROR_URL=@STX_MIRROR_URL@ export STX_MIRROR_URL=@STX_MIRROR_URL@
# STX_MIRROR_STRATEGY value: [ stx_mirror|stx_mirror_first|upstream|upstream_first ] # STX_MIRROR_STRATEGY value: [ stx_mirror|stx_mirror_first|upstream|upstream_first ]

View File

@ -83,17 +83,18 @@ class Debbuilder:
return return
self.logger.debug("%s does exist", STX_LOCALRC) self.logger.debug("%s does exist", STX_LOCALRC)
# backward compatability with CENGNURL # dpanech: this doesn't work becauise STX_LOCALRC is mounted read-only from the host
self.logger.debug("Fixing CENGNURL references in stx-localrc") ## backward compatability with CENGNURL
cmd = "sed -i 's#CENGNURL#STX_MIRROR_URL#' %s" % (STX_LOCALRC) #self.logger.debug("Fixing CENGNURL references in stx-localrc")
self.logger.debug('The substitution command is %s', cmd) #cmd = "sed -i 's#CENGNURL#STX_MIRROR_URL#' %s" % (STX_LOCALRC)
try: #self.logger.debug('The substitution command is %s', cmd)
outs = subprocess.check_output(cmd, shell=True).decode() #try:
except Exception as e: # outs = subprocess.check_output(cmd, shell=True).decode()
self.logger.error(str(e)) #except Exception as e:
self.logger.error("Failed to substitute %s in %s", "CENGNURL", STX_LOCALRC) # self.logger.error(str(e))
return # self.logger.error("Failed to substitute %s in %s", "CENGNURL", STX_LOCALRC)
# end of backward compatibility # return
## end of backward compatibility
for var in ENVIRON_VARS: for var in ENVIRON_VARS:
self.logger.debug("Fetching %s from stx-localrc", var) self.logger.debug("Fetching %s from stx-localrc", var)

View File

@ -61,7 +61,7 @@ commands =
# W504 line break after binary operator # W504 line break after binary operator
# F401 'XXXXX' imported but unused # F401 'XXXXX' imported but unused
show-source = True show-source = True
ignore = E123,E125,E501,H404,H405,W504,F401 ignore = E123,E125,E265,E266,E501,H404,H405,W504,F401
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-* exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
[testenv:venv] [testenv:venv]