|
31 | 31 | __metaclass__ = type |
32 | 32 |
|
33 | 33 | import time |
34 | | -from ansible.errors import AnsibleActionFail |
35 | 34 | from ansible.module_utils.six import iteritems |
36 | 35 | from ansible.module_utils.urls import CertificateError |
37 | 36 | from ansible.module_utils.connection import ConnectionError |
|
94 | 93 |
|
95 | 94 |
|
96 | 95 | def _fail_json(msg): |
97 | | - """Replace the AnsibleModule fai;_json here |
| 96 | + """Replace the AnsibleModule fail_json here |
98 | 97 | :param msg: The message for the failure |
99 | 98 | :type msg: str |
100 | 99 | """ |
101 | | - raise AnsibleActionFail(msg) |
| 100 | + raise Exception(msg) |
102 | 101 |
|
103 | 102 |
|
104 | 103 | def map_params_to_obj(module_params, key_transform): |
@@ -532,7 +531,7 @@ def api_command(module, command): |
532 | 531 |
|
533 | 532 | code, response = send_request(connection, version, command, payload) |
534 | 533 | result = {"changed": True} |
535 | | - |
| 534 | + |
536 | 535 | if command.startswith("show"): |
537 | 536 | result['changed'] = False |
538 | 537 |
|
@@ -679,15 +678,15 @@ def api_call(module, api_call_object): |
679 | 678 | return result |
680 | 679 |
|
681 | 680 |
|
682 | | -# returns a generator of the entire rulebase |
| 681 | +# returns a generator of the entire rulebase. show_rulebase_identifier_payload can be either package or layer |
683 | 682 | def get_rulebase_generator( |
684 | 683 | connection, version, show_rulebase_identifier_payload, show_rulebase_command, rules_amount |
685 | 684 | ): |
686 | 685 | offset = 0 |
687 | 686 | limit = 100 |
688 | 687 | while True: |
689 | 688 | payload_for_show_rulebase = { |
690 | | - **show_rulebase_identifier_payload, # package or layer |
| 689 | + **show_rulebase_identifier_payload, |
691 | 690 | "limit": limit, |
692 | 691 | "offset": offset, |
693 | 692 | } |
|
0 commit comments