How to use the jc.parsers.iptables.parse function in jc

To help you get started, we’ve selected a few jc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_mangle_ubuntu_18_4(self):
        """
        Test 'sudo iptables -L -t mangle' on Ubuntu 18.4
        """
        self.assertEqual(jc.parsers.iptables.parse(self.ubuntu_18_4_iptables_mangle, quiet=True), self.ubuntu_18_4_iptables_mangle_json)
github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_filter_ubuntu_18_4(self):
        """
        Test 'sudo iptables -L -t filter' on Ubuntu 18.4
        """
        self.assertEqual(jc.parsers.iptables.parse(self.ubuntu_18_4_iptables_filter, quiet=True), self.ubuntu_18_4_iptables_filter_json)
github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_raw_centos_7_7(self):
        """
        Test 'sudo iptables -L -t raw' on Centos 7.7
        """
        self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_raw, quiet=True), self.centos_7_7_iptables_raw_json)
github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_mangle_centos_7_7(self):
        """
        Test 'sudo iptables -L -t mangle' on Centos 7.7
        """
        self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_mangle, quiet=True), self.centos_7_7_iptables_mangle_json)
github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_nat_centos_7_7(self):
        """
        Test 'sudo iptables -L -t nat' on Centos 7.7
        """
        self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_nat, quiet=True), self.centos_7_7_iptables_nat_json)
github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_filter_nv_centos_7_7(self):
        """
        Test 'sudo iptables -nvL -t filter' on Centos 7.7
        """
        self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_filter_nv, quiet=True), self.centos_7_7_iptables_filter_nv_json)
github kellyjonbrazil / jc / tests / test_iptables.py View on Github external
def test_iptables_filter_centos_7_7(self):
        """
        Test 'sudo iptables -L -t filter' on Centos 7.7
        """
        self.assertEqual(jc.parsers.iptables.parse(self.centos_7_7_iptables_filter, quiet=True), self.centos_7_7_iptables_filter_json)
github kellyjonbrazil / jc / jc / jc.py View on Github external
result = jc.parsers.dig.parse(data, raw=raw, quiet=quiet)

    elif '--env' in sys.argv:
        result = jc.parsers.env.parse(data, raw=raw, quiet=quiet)

    elif '--free' in sys.argv:
        result = jc.parsers.free.parse(data, raw=raw, quiet=quiet)

    elif '--history' in sys.argv:
        result = jc.parsers.history.parse(data, raw=raw, quiet=quiet)

    elif '--ifconfig' in sys.argv:
        result = jc.parsers.ifconfig.parse(data, raw=raw, quiet=quiet)

    elif '--iptables' in sys.argv:
        result = jc.parsers.iptables.parse(data, raw=raw, quiet=quiet)

    elif '--jobs' in sys.argv:
        result = jc.parsers.jobs.parse(data, raw=raw, quiet=quiet)

    elif '--ls' in sys.argv:
        result = jc.parsers.ls.parse(data, raw=raw, quiet=quiet)

    elif '--lsblk' in sys.argv:
        result = jc.parsers.lsblk.parse(data, raw=raw, quiet=quiet)

    elif '--lsmod' in sys.argv:
        result = jc.parsers.lsmod.parse(data, raw=raw, quiet=quiet)

    elif '--lsof' in sys.argv:
        result = jc.parsers.lsof.parse(data, raw=raw, quiet=quiet)