Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python
import shlex
import subprocess
import sys
def main():
# NOTE(andyhky): Refer to
# for definitions of controller vs. manager.
manager = "ovs-vsctl find manager is_connected=false"
controller = "ovs-vsctl find controller is_connected=false"
mgr_stdout = subprocess.Popen(shlex.split(manager),
ctrl_stdout = subprocess.Popen(shlex.split(controller),
# NOTE(ahill): These commands should only return 0 with no output.
if len(mgr_stdout.readlines()) != 0 or len(ctrl_stdout.readlines()) != 0:
return 1
return 0
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment