[Pkg-ganeti-devel] [ganeti] 128/165: Set up Transport properly when communicating with metad

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Tue Aug 11 13:53:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit cdc8341764405d5ee1624a09a83d5882b048a06e
Author: Petr Pudlak <pudlak at google.com>
Date:   Fri Jun 5 14:23:56 2015 +0200

    Set up Transport properly when communicating with metad
    
    .. so it retries correctly when communicating on a non-master node.
    
    Signed-off-by: Petr Pudlak <pudlak at google.com>
    Reviewed-by: Helga Velroyen <helgav at google.com>
---
 lib/metad.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/metad.py b/lib/metad.py
index deb4d66..34d8a56 100644
--- a/lib/metad.py
+++ b/lib/metad.py
@@ -77,6 +77,15 @@ if constants.ENABLE_METAD:
           logging.debug("Will retry")
           time.sleep(try_no * 10 + 10 * random.random())
 
+      def _InitTransport(self):
+        """(Re)initialize the transport if needed.
+
+        """
+        if self.transport is None:
+          self.transport = self.transport_class(self._GetAddress(),
+                                                timeouts=self.timeouts,
+                                                allow_non_master=True)
+
 else:
   class Client(object):
     """An empty client representation that just throws an exception.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list