Module rpc
source code
Inter-node RPC library.
|
|
|
|
|
|
|
|
|
|
list of addresses and/or None's
|
_AddressLookup(node_list,
ssc=ssconf.SimpleStore,
nslookup_fn=netutils.Hostname.GetIP)
Return addresses for given node names. |
source code
|
|
|
_EncodeImportExportIO(ieio,
ieioargs)
Encodes import/export I/O information. |
source code
|
|
|
_RPC_CONNECT_TIMEOUT = 5
|
|
_RPC_CLIENT_HEADERS = ["Content-type: %s" % http.HTTP_APP_JSON...
|
|
_TMO_URGENT = 60
|
|
_TMO_FAST = 5* 60
|
|
_TMO_NORMAL = 15* 60
|
|
_TMO_SLOW = 3600
|
|
_TMO_4HRS = 4* 3600
|
|
_TMO_1DAY = 86400
|
|
_TIMEOUTS = {}
|
|
_thread_local = _RpcThreadLocal()
|
Imports:
os,
logging,
zlib,
base64,
pycurl,
threading,
utils,
objects,
http,
serializer,
constants,
errors,
netutils,
ssconf,
ganeti
Initializes the module-global HTTP client manager.
Must be called before using any RPC function and while exactly one
thread is running.
|
Stops the module-global HTTP client manager.
Must be called before quitting the program and while exactly one
thread is running.
|
Timeout decorator.
When applied to a rpc call_* function, it updates the global timeout
table with the given function/timeout.
|
RPC-wrapper decorator.
When applied to a function, it runs it with the RPC system
initialized, and it shutsdown the system afterwards. This means the
function must be called without RPC being initialized.
|
_AddressLookup(node_list,
ssc=ssconf.SimpleStore,
nslookup_fn=netutils.Hostname.GetIP)
| source code
|
Return addresses for given node names.
- Parameters:
node_list (list) - List of node names
ssc (class) - SimpleStore class that is used to obtain node->ip mappings
nslookup_fn (callable) - function use to do NS lookup
- Returns: list of addresses and/or None's
- List of corresponding addresses, if found
|
_RPC_CLIENT_HEADERS
- Value:
["Content-type: %s" % http.HTTP_APP_JSON, "Expect:",]
|
|