LMIMethod Package¶
- class lmi.shell.LMIMethod.LMIMethod(conn, lmi_instance, method_name)¶
LMI wrapper class representing wbem.CIMMethod.
Parameters: - conn (LMIConnection) – connection object
- lmi_instance (LMIInstance(Name)) – LMIInstance or LMIInstanceName object, on which the method call will be issued
- method_name (string) – method name
- doc()¶
Prints out pretty verbose message with documentation for the class. If the LMIShell is run in a interactive mode, the output will be redirected to a pager set by environment variable PAGER. If there is not PAGER set, less or more will be used as a fall-back.
- parameters()¶
Returns: list of strings of wbem.CIMMethod‘s parameters
- print_parameters()¶
Prints out wbem.CIMMethod‘s parameters.
- print_valuemap_parameters()¶
Prints out the list of strings of constant names.
- return_type¶
Returns: string of the method call’s return type
- tomof()¶
Prints out a message with MOF representation of wbem.CIMMethod. If the LMIShell is run in a interactive mode, the output will be redirected to a pager set by environment variable PAGER. If there is not PAGER set, less or more will be used as a fall-back.
- valuemap_parameters()¶
Returns: list of strings of the constant names
- wrapped_object¶
Returns: wrapped wbem.CIMmethod object
- class lmi.shell.LMIMethod.LMIMethodSignalHelper¶
Helper class which takes care of signal (de)registration and handling.
- INTERRUPT_SIGNALS = (2, 15)¶
- callback_attach(cb_name, cb)¶
Registers a callback, which will be called when a SIGINT or SIGTERM is caught.
Parameters: - cb_name (string) – callback name
- cb – callable object, which takes zero arguments
- callback_detach(cb_name)¶
Removes a callback from the callback dictionary.
Parameters: cb_name (string) – callback name
- signal_attach()¶
Registers SIGINT and SIGTERM signals to local handler in which, the flags for each signal are modified, if such signal is caught.
- signal_detach()¶
Unregisters SIGINT and SIGTERM handler and removes all the attached callbacks.
- signal_handled()¶
Returns: True, if any of SIGINT or SIGTERM has been caught; False otherwise
- signal_handler(signo, frame)¶
Signal handler, which is called, when SIGINT and SIGTERM are sent to the LMIShell.
Parameters: - signo (int) – signal number
- frame – – stack frame
- class lmi.shell.LMIMethod.LMISignalHelperBase¶
Base signal handling class.
- static signal(signo, handler)¶
Calls signal() for signo, handler and returns the old signal handler. If signo is list of signals, the signal() call is applied for each signo. If handler is also list, each signal from signo will be handled by corresponding handler. In such case, tuple of previous handlers will be returned.
- static signal_core(signo, handler)¶
Wrapper method for signal.signal(). In case of ValueError, it returns None, old signal handler otherwise. If handler is None, default signal handler is set for such signal.