diff --git a/controllerconfig/controllerconfig/scripts/dhcp-renew.sh b/controllerconfig/controllerconfig/scripts/dhcp-renew.sh deleted file mode 100644 index 3db0434820..0000000000 --- a/controllerconfig/controllerconfig/scripts/dhcp-renew.sh +++ /dev/null @@ -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 diff --git a/controllerconfig/debian/deb_folder/rules b/controllerconfig/debian/deb_folder/rules index 5706f4d62d..325285ce53 100755 --- a/controllerconfig/debian/deb_folder/rules +++ b/controllerconfig/debian/deb_folder/rules @@ -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 diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index 9386277989..c2e72fcbd5 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -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)