Revision 42ab9ac4 lib/cli.py
b/lib/cli.py | ||
---|---|---|
2082 | 2082 |
op.priority = _PRIONAME_TO_VALUE[options.priority] |
2083 | 2083 |
|
2084 | 2084 |
|
2085 |
def GetClient(): |
|
2085 |
def GetClient(query=False): |
|
2086 |
"""Connects to the a luxi socket and returns a client. |
|
2087 |
|
|
2088 |
@type query: boolean |
|
2089 |
@param query: this signifies that the client will only be |
|
2090 |
used for queries; if the build-time parameter |
|
2091 |
enable-split-queries is enabled, then the client will be |
|
2092 |
connected to the query socket instead of the masterd socket |
|
2093 |
|
|
2094 |
""" |
|
2095 |
if query and constants.ENABLE_SPLIT_QUERY: |
|
2096 |
address = constants.QUERY_SOCKET |
|
2097 |
else: |
|
2098 |
address = None |
|
2086 | 2099 |
# TODO: Cache object? |
2087 | 2100 |
try: |
2088 |
client = luxi.Client() |
|
2101 |
client = luxi.Client(address=address)
|
|
2089 | 2102 |
except luxi.NoMasterError: |
2090 | 2103 |
ss = ssconf.SimpleStore() |
2091 | 2104 |
|
Also available in: Unified diff