Remove obsolete upgrade related code for stx-11

This change removes upgrade related code that is not necessary for
stx-10 -> stx-11 upgrade scenario.

Test plan

[PASS] Perform upgrade procedure for standard system (2 controllers +
       2 storages + 1 compute) up to deploy-hosts-done stage

Story: 2011357
Task: 51728
Change-Id: I37d9f5753a35a53efdbd4eb8220d9aaf8e0337f4
Signed-off-by: Lucas Ratusznei Fonseca <lucas.ratuszneifonseca@windriver.com>
This commit is contained in:
Lucas Ratusznei Fonseca 2025-02-27 21:19:58 -03:00
parent d1f6a35476
commit 670fe6e725
3 changed files with 0 additions and 93 deletions

View File

@ -1,56 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
NAME=$(basename $0)
# The interface name for which the DHCP lease has to be renewed
IFACE=$1
MAX_REMOVE_ATTEMPTS=3
REQUEST_ATTEMPT_TIMES=(0 5 10 15 20)
# This will log to /var/log/platform.log
function log {
logger -p local1.info $1
}
function remove_lease {
for attempt in $(/usr/bin/seq 1 $MAX_REMOVE_ATTEMPTS)
do
log "$NAME: Removing DHCP lease for interface $IFACE, attempt $attempt"
/usr/sbin/dhclient -r $IFACE
if [ $? -eq 0 ]; then
log "$NAME: Successfully removed DHCP lease for interface $IFACE"
return
fi
done
log "$NAME: Failed to remove DHCP lease for interface $IFACE"
exit 1
}
function request_lease {
for time in "${REQUEST_ATTEMPT_TIMES[@]}"
do
if [ "$time" != "0" ]; then
log "$NAME: Waiting $time seconds before retrying to get a lease for interface $IFACE"
sleep $time
fi
log "$NAME: Requesting DHCP lease for interface $IFACE"
/usr/sbin/dhclient -1 $IFACE
if [ $? -eq 0 ]; then
log "$NAME: Received DHCP lease for interface $IFACE"
return
fi
done
log "$NAME: Failed to get DHCP lease for interface $IFACE"
exit 1
}
remove_lease $IFACE
request_lease $IFACE
exit 0

View File

@ -16,7 +16,6 @@ override_dh_install:
install -p -D -m 700 scripts/upgrade_swact_migration.py $(ROOT)/usr/bin/upgrade_swact_migration.py
install -p -D -m 755 scripts/image-backup.sh $(ROOT)/usr/bin/image-backup.sh
install -p -D -m 755 scripts/sysinv-service-restart.sh $(ROOT)/usr/bin/sysinv-service-restart.sh
install -p -D -m 755 scripts/dhcp-renew.sh $(ROOT)/usr/bin/dhcp-renew.sh
install -d -m 755 $(ROOT)/etc/goenabled.d/
install -p -D -m 700 scripts/config_goenabled_check.sh $(ROOT)/etc/goenabled.d/config_goenabled_check.sh.controller
install -d -m 755 $(ROOT)/etc/init.d

View File

@ -1405,8 +1405,6 @@ class ConductorManager(service.PeriodicService):
constants.NETWORK_TYPE_MGMT
)
is_upgrading, upgrade = cutils.is_upgrade_in_progress(self.dbapi)
func = "_generate_dnsmasq_hosts_file"
with open(temp_dnsmasq_hosts_file, 'w') as f_out, \
open(temp_dnsmasq_addn_hosts_file, 'w') as f_out_addn:
@ -1460,40 +1458,6 @@ class ConductorManager(service.PeriodicService):
address.address, hostname_internal, hostname_alias)
f_out_addn.write(addn_line_internal)
if address.interface:
mac_address = address.interface.imac
# For cloning scenario, controller-1 MAC address will
# be updated in ethernet_interfaces table only later
# when sysinv-agent is initialized on controller-1.
# So, use the mac_address passed in (got from PXE request).
if (existing_host and
constants.CLONE_ISO_MAC in mac_address and
hostname == existing_host.hostname):
LOG.info("gen dnsmasq (clone):{}:{}->{}"
.format(hostname, mac_address,
existing_host.mgmt_mac))
mac_address = existing_host.mgmt_mac
if not is_upgrading or "activate" in upgrade.state:
continue
# If host is being deleted, don't check ihost
if deleted_hostname and deleted_hostname == hostname:
continue
try:
ihost = self.dbapi.ihost_get_by_hostname(hostname)
if ihost.personality == constants.CONTROLLER:
continue
mac_address = ihost.mgmt_mac
except exception.NodeNotFound:
continue
line = self._dnsmasq_host_entry_to_string(address.address,
hostname,
mac_address)
f_out.write(line)
# Add pxecontroller to dnsmasq.hosts file
pxeboot_network = self.dbapi.network_get_by_type(
constants.NETWORK_TYPE_PXEBOOT)