commands
drunc.unified_shell.commands
Classes
Functions:
echo(obj, text, server, target_server, logger, target, severity, execute_along_path, execute_on_all_subsequent_children_in_path)
Log a message locally or send it to selected servers.
Without server mode, the message is logged locally. In server mode, it can be sent to the process manager, controller, or both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
ProcessManagerContext
|
The unified shell context. |
required |
text
|
str
|
The log message text. |
required |
target_server
|
str
|
The server to target, or all servers when empty. |
required |
logger
|
int
|
The selected logger target. |
required |
severity
|
str
|
The log severity level. |
required |
Source code in drunc/unified_shell/commands.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
session_injector(f)
Decorator to inject the session name into the command function.
This is used to wrap the relevant unified shell commands, as the unified shell is intended to only operate a single session at a time, and the session name is stored in the context object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
FC
|
The command function to wrap. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
FC |
FC
|
The wrapped command function with the session name injected. |
Source code in drunc/unified_shell/commands.py
start_shell(ctx, obj)
Start an interactive shell session.
This command stops batch mode and enters an interactive shell state, allowing you to execute commands interactively.
Source code in drunc/unified_shell/commands.py
terminate(ctx, obj, width, fit)
Execute the process manager terminate command, but only do this for the current session