get rule by uuid, in string format
(self, uuid, naddr=None)
| 138 | return self.rules.swap(view, addr, uuid, old_pos, new_pos) |
| 139 | |
| 140 | def get_rule_by_uuid(self, uuid, naddr=None): |
| 141 | """get rule by uuid, in string format |
| 142 | """ |
| 143 | if uuid == "": |
| 144 | return None, None |
| 145 | for addr in self._nodes.get_nodes(): |
| 146 | node = self._nodes.get_node(addr) |
| 147 | if not 'fwrules' in node: |
| 148 | continue |
| 149 | if naddr is not None and naddr != addr: |
| 150 | continue |
| 151 | r = node['fwrules'].get(uuid) |
| 152 | if r is not None: |
| 153 | return addr, r |
| 154 | |
| 155 | return None, None |
| 156 | |
| 157 | def get_protorule_by_uuid(self, addr, uuid): |
| 158 | """get protobuffer rule by uuid. |
no test coverage detected