From b481bfb90b96c70d5d7c988b111058137b1ca60e Mon Sep 17 00:00:00 2001 From: zsdc Date: Sat, 13 Feb 2021 19:56:29 +0200 Subject: dhclient: T3309: Removed dhclient from datasources After the commit 377d1bbbdd45aad25c36ab15ce15c93a39df4ce9 dhclient should be run by Cloud-init properly even without calls from datasources, if this is necessary. This change solves the problems caused by always active dhclient on eth0 interface when Ec2, GCE, or Azure datasource is used. --- cloudinit/sources/DataSourceGCE.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'cloudinit/sources/DataSourceGCE.py') diff --git a/cloudinit/sources/DataSourceGCE.py b/cloudinit/sources/DataSourceGCE.py index f72d9836..d8162623 100644 --- a/cloudinit/sources/DataSourceGCE.py +++ b/cloudinit/sources/DataSourceGCE.py @@ -2,10 +2,8 @@ # # This file is part of cloud-init. See LICENSE file for license information. -import os import datetime import json -from subprocess import call from base64 import b64decode @@ -20,7 +18,6 @@ LOG = logging.getLogger(__name__) MD_V1_URL = 'http://metadata.google.internal/computeMetadata/v1/' BUILTIN_DS_CONFIG = {'metadata_url': MD_V1_URL} REQUIRED_FIELDS = ('instance-id', 'availability-zone', 'local-hostname') -DEFAULT_PRIMARY_NIC = 'eth0' class GoogleMetadataFetcher(object): @@ -53,11 +50,6 @@ class GoogleMetadataFetcher(object): class DataSourceGCE(sources.DataSource): dsname = 'GCE' - process_name = 'dhclient' - - tmpps = os.popen("ps -Af").read() - if process_name not in tmpps[:]: - call(['/sbin/dhclient', DEFAULT_PRIMARY_NIC]) def __init__(self, sys_cfg, distro, paths): sources.DataSource.__init__(self, sys_cfg, distro, paths) -- cgit v1.2.3