From 14f5f1b674f1c386f5d1af78cf9f542ceefc206b Mon Sep 17 00:00:00 2001
From: Manuel Franceschini <livewire@google.com>
Date: Mon, 28 Jun 2010 18:58:16 +0200
Subject: [PATCH] Replace '0.0.0.0' with constant

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/daemon.py            | 2 +-
 lib/hypervisor/hv_kvm.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/daemon.py b/lib/daemon.py
index 2027a4b31..304b52705 100644
--- a/lib/daemon.py
+++ b/lib/daemon.py
@@ -551,7 +551,7 @@ def GenericMain(daemon_name, optionparser, dirs, check_fn, exec_fn,
                           choices=["no", "yes", "only"])
 
   if daemon_name in constants.DAEMONS_PORTS:
-    default_bind_address = "0.0.0.0"
+    default_bind_address = constants.IP4_ADDRESS_ANY
     default_port = utils.GetDaemonPort(daemon_name)
 
     # For networked daemons we allow choosing the port and bind address
diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
index 81499b584..67d83cca2 100644
--- a/lib/hypervisor/hv_kvm.py
+++ b/lib/hypervisor/hv_kvm.py
@@ -517,7 +517,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
       if utils.IsValidIP(vnc_bind_address):
         if instance.network_port > constants.VNC_BASE_PORT:
           display = instance.network_port - constants.VNC_BASE_PORT
-          if vnc_bind_address == '0.0.0.0':
+          if vnc_bind_address == constants.IP4_ADDRESS_ANY:
             vnc_arg = ':%d' % (display)
           else:
             vnc_arg = '%s:%d' % (vnc_bind_address, display)
-- 
GitLab