result
nornir_scrapli.result
ScrapliResult
¶
Bases: Result
Source code in nornir_scrapli/result.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
__init__(host: Host, result: Optional[str], scrapli_response: Optional[Union[Response, MultiResponse, ScrapliCfgResponse]] = None, changed: bool = False, **kwargs: Any)
¶
Scrapli Nornir Result object
A "normal" nornir result object with an additional attribute "scrapli_response" which houses the original response object returned from scrapli
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host |
Host
|
nornir task host object |
required |
result |
Optional[str]
|
result text returned from scrapli task |
required |
scrapli_response |
Optional[Union[Response, MultiResponse, ScrapliCfgResponse]]
|
original response object returned from scrapli task |
None
|
changed |
bool
|
bool indicating if a change has occurred |
False
|
kwargs |
keyword arguments to pass to nornir Result |
required |
Returns:
Type | Description |
---|---|
N/A # noqa: DAR202 |
Source code in nornir_scrapli/result.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
process_command_result(scrapli_response: Union[Response, MultiResponse]) -> str
¶
Process and return string of scrapli response(s)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scrapli_response |
Union[Response, MultiResponse]
|
scrapli Response or MultiResponse object |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
string result from nornir task or None |
Source code in nornir_scrapli/result.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
process_config_result(scrapli_response: Union[Response, MultiResponse]) -> str
¶
Process and return string of scrapli response(s)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scrapli_response |
Union[Response, MultiResponse]
|
scrapli Response or MultiResponse object |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
string result from nornir task or None |
Source code in nornir_scrapli/result.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|