code: def wait_for_command(logs_generator):
      
      logger.info("wait_for_command")
      cr = CommandResult()
      for item in logs_generator:
          cr.parse_item(item)
  
      logger.info("no more logs")
      return cr
docs: Create a CommandResult from given iterator
  
      :return: CommandResult