summaryrefslogtreecommitdiff
path: root/azurelinuxagent/ga/env.py
diff options
context:
space:
mode:
Diffstat (limited to 'azurelinuxagent/ga/env.py')
-rw-r--r--azurelinuxagent/ga/env.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/azurelinuxagent/ga/env.py b/azurelinuxagent/ga/env.py
index 2d67d4b..5d8da5c 100644
--- a/azurelinuxagent/ga/env.py
+++ b/azurelinuxagent/ga/env.py
@@ -45,7 +45,8 @@ class EnvHandler(object):
self.stopped = True
self.hostname = None
self.dhcpid = None
- self.server_thread=None
+ self.server_thread = None
+ self.dhcp_warning_enabled = True
def run(self):
if not self.stopped:
@@ -87,8 +88,11 @@ class EnvHandler(object):
def handle_dhclient_restart(self):
if self.dhcpid is None:
- logger.warn("Dhcp client is not running. ")
+ if self.dhcp_warning_enabled:
+ logger.warn("Dhcp client is not running. ")
self.dhcpid = self.osutil.get_dhcp_pid()
+ # disable subsequent error logging
+ self.dhcp_warning_enabled = self.dhcpid is not None
return
#The dhcp process hasn't changed since last check