How to use the ifcfg.tools.exec_cmd function in ifcfg

To help you get started, we’ve selected a few ifcfg 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 ftao / python-ifcfg / tests / tools_tests.py View on Github external
def test_command_non_unicode(self):
        getpreferredencoding_orig = locale.getpreferredencoding
        locale.getpreferredencoding = lambda: "ISO-8859-1"
        output, __, __ = exec_cmd("echo -n 'this is a test'")
        self.assertEqual(output, "this is a test")
        locale.getpreferredencoding = getpreferredencoding_orig
github ftao / python-ifcfg / tests / tools_tests.py View on Github external
def test_command(self):
        output, __, __ = exec_cmd("echo -n 'this is a test'")
        self.assertEqual(output, "this is a test")