Revision d73ef63f lib/confd/querylib.py

b/lib/confd/querylib.py
1
#!/usr/bin/python
1
#
2 2
#
3 3

  
4 4
# Copyright (C) 2009, Google Inc.
......
27 27

  
28 28
from ganeti import constants
29 29

  
30

  
30 31
# constants for some common errors to return from a query
31 32
QUERY_UNKNOWN_ENTRY_ERROR = (constants.CONFD_REPL_STATUS_ERROR,
32 33
                             constants.CONFD_ERROR_UNKNOWN_ENTRY)
33 34
QUERY_INTERNAL_ERROR = (constants.CONFD_REPL_STATUS_ERROR,
34 35
                        constants.CONFD_ERROR_INTERNAL)
35 36

  
37

  
36 38
class ConfdQuery(object):
37 39
  """Confd Query base class.
38 40

  
......
82 84

  
83 85
    return status, answer
84 86

  
87

  
85 88
class ClusterMasterQuery(ConfdQuery):
86 89
  """Cluster master query.
87 90

  
......
163 166
      return QUERY_INTERNAL_ERROR
164 167

  
165 168
    return constants.CONFD_REPL_STATUS_OK, pnode_primary_ip
166

  

Also available in: Unified diff