Ejemplo n.º 1
0
 def check_declarative_intent_params(self, result):
     if not result['changed']:
         return
     delay_interval = self._required_config.get('delay')
     if delay_interval > 0:
         time.sleep(delay_interval)
         for cmd in ("show mlag-vip", ""):
             show_cmd(self._module, cmd, json_fmt=False, fail_on_error=False)
Ejemplo n.º 2
0
 def _show_ntp_config(self):
     show_cmds = []
     cmd = "show ntp"
     show_cmds.append(
         show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False))
     cmd = "show ntp keys"
     show_cmds.append(
         show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False))
     return show_cmds
Ejemplo n.º 3
0
 def _show_snmp_config(self):
     show_cmds = []
     cmd = "show snmp"
     show_cmds.append(
         show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False))
     cmd = "show running-config | include snmp"
     show_cmds.append(
         show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False))
     return show_cmds
Ejemplo n.º 4
0
    def show_logging(self):
        show_logging = show_cmd(self._module, "show logging", json_fmt=True, fail_on_error=False)
        running_config = show_cmd(self._module, "show running-config | include .*logging.*debug-files.*", json_fmt=True, fail_on_error=False)

        if len(show_logging) > 0:
            show_logging[0]['debug'] = running_config['Lines'] if 'Lines' in running_config else []
        else:
            show_logging = [{
                'debug': running_config['Lines'] if 'Lines' in running_config else []
            }]
        return show_logging
Ejemplo n.º 5
0
 def _get_ospf_interfaces_config(self, ospf_id):
     cmd = 'show ip ospf interface %s brief' % ospf_id
     return show_cmd(self._module, cmd, json_fmt=False, fail_on_error=False)
Ejemplo n.º 6
0
 def _show_mlag_data(self):
     cmd = "show mlag"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 7
0
 def _get_wjh_config(self):
     return show_cmd(self._module,
                     "show running-config | include .*what-just-happened.*",
                     json_fmt=False,
                     fail_on_error=False)
Ejemplo n.º 8
0
 def _show_users(self):
     cmd = "show snmp user"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
 def _get_lldp_config(self):
     return show_cmd(self._module, "show lldp interfaces")
Ejemplo n.º 10
0
 def _get_ospf_config(self, ospf_id):
     cmd = 'show ip ospf %s | include Process' % ospf_id
     return show_cmd(self._module, cmd, json_fmt=False, fail_on_error=False)
Ejemplo n.º 11
0
 def _show_cmd(self, cmd):
     return show_cmd(self.module, cmd, json_fmt=True)
Ejemplo n.º 12
0
 def _get_protocols(self):
     return show_cmd(self._module, "show protocols")
Ejemplo n.º 13
0
 def _get_ip_routing(self):
     return show_cmd(self._module,
                     'show ip routing | include "IP routing"',
                     json_fmt=False)
Ejemplo n.º 14
0
 def _get_magp_config(self):
     cmd = "show magp"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 15
0
 def show_logging(self):
     # we can't use show logging it has lack of information
     return show_cmd(self._module, "show running-config | include .*logging.*", json_fmt=False, fail_on_error=False)
Ejemplo n.º 16
0
 def _get_vlan_config(self):
     return show_cmd(self._module, "show vlan")
Ejemplo n.º 17
0
 def _show_interface_qos(self, if_type, interface):
     cmd = "show qos interface {0} {1}".format(if_type, interface)
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 18
0
 def _get_ospf_interfaces_config(self, ospf_id):
     cmd = 'show ip ospf interface %s brief' % ospf_id
     return show_cmd(self._module, cmd, json_fmt=False, fail_on_error=False)
Ejemplo n.º 19
0
 def _show_vxlan_config(self):
     cmd = "show interfaces nve"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 20
0
 def _show_hosts_config(self):
     cmd = "show snmp host"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 21
0
 def _show_mlag_cmd(self, cmd):
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 22
0
 def _show_cmd(self, cmd):
     return show_cmd(self.module, cmd, json_fmt=True)
Ejemplo n.º 23
0
 def _show_aaa_config(self):
     cmd = "show aaa"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 24
0
 def _get_protocols(self):
     return show_cmd(self._module, "show protocols")
Ejemplo n.º 25
0
 def _show_igmp_interfaces(self):
     cmd = "show ip igmp snooping interfaces"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 26
0
 def _get_ip_routing(self):
     return show_cmd(self._module, 'show ip routing | include "IP routing"',
                     json_fmt=False)
Ejemplo n.º 27
0
 def _get_vlan_config(self):
     return show_cmd(self._module, "show vlan")
Ejemplo n.º 28
0
 def _get_magp_config(self):
     cmd = "show magp"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 29
0
 def _show_peers_servers_config(self):
     cmd = "show ntp configured"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 30
0
 def _get_pfc_config(self):
     return show_cmd(self._module, "show dcb priority-flow-control")
Ejemplo n.º 31
0
 def _get_lldp_config(self):
     return show_cmd(self._module, "show lldp interfaces")
Ejemplo n.º 32
0
 def _get_lldp_config(self):
     return show_cmd(self._module, self.SHOW_LLDP_CMD)
Ejemplo n.º 33
0
 def _get_ospf_config(self, ospf_id):
     cmd = 'show ip ospf %s | include Process' % ospf_id
     return show_cmd(self._module, cmd, json_fmt=False, fail_on_error=False)
Ejemplo n.º 34
0
 def _get_username_config(self):
     return show_cmd(self._module,
                     "show usernames",
                     json_fmt=True,
                     fail_on_error=False)
Ejemplo n.º 35
0
 def _show_traffic_pool(self):
     cmd = "show traffic pool {0}".format(self._required_config.get("name"))
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
 def _show_ptp_interface_config(self):
     cmd = "show ptp interface %s %s" % (self._interface_type,
                                         self._interface_id)
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 37
0
 def _show_nve_detail(self):
     cmd = "show interface nve {0} detail".format(
         self._required_config.get("nve_id"))
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 38
0
 def _show_bfd_config(self):
     cmd = "show running-config | include bfd"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 39
0
 def _show_ptp_config(self):
     cmd = "show ptp clock"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)
Ejemplo n.º 40
0
 def _show_mlag_data(self):
     cmd = "show mlag"
     return show_cmd(self._module, cmd, json_fmt=True, fail_on_error=False)