def execute(self, command, nodes):
        """
        Executes a line in shell on specified boxes
        """
        try:
            for node in nodes:
                for key, value in self.executor.execute(
                    command, nodes=[node]
                ).items():
                    if value["ret_code"] > 0:
                        print(colored("-" * 80, "red"))
                        print(colored(key, "red"))
                        print(colored(value.get("stdout", ""), "red"))
                        print(colored(value.get("stderr", ""), "red"))
                        print(colored(value.get("error", ""), "red"))
                    else:
                        print(colored("-" * 80, "green"))
                        print(colored(key, "green"))
                        print(colored(value.get("stdout", ""), "white"))
                        if value.get("stderr"):
                            print(colored(value.get("stderr", ""), "red"))
        except KeyboardInterrupt:
            print(colored("-" * 80, "red"))
            print(colored("Interrupted by user", "red"))

        Executes a line in shell on specified boxes
        
powerfulseal/cli/pscmd.py