example_helpers.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:cbapi-python 作者: carbonblack 项目源码 文件源码
def do_connect(self, line):
        """
        Command: connect

        Description:
        Connect to a sensor given the sensor ID or the sensor hostname.

        Args:
        connect SENSOR_ID | SENSOR_HOSTNAME
        """
        if not line:
            raise CliArgsException("Need argument: sensor ID or hostname")

        sensor = self.connect_callback(self.cb, line)
        self.lr_session = sensor.lr_session()

        print("Session: {0}".format(self.lr_session.session_id))
        print("  Available Drives: %s" % ' '.join(self.lr_session.session_data.get('drives', [])))

        # look up supported commands
        print("  Supported Commands: %s" % ', '.join(self.lr_session.session_data.get('supported_commands', [])))
        print("  Working Directory: %s" % self.cwd)

        log.info("Attached to sensor {0}".format(sensor._model_unique_id))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号