Esempio n. 1
0
    def _do_check(self, arm_ip):
        chan = self._client.get_transport().open_channel(
            'direct-tcpip', (arm_ip, 22), ('localhost', 44444))
        c = paramiko.SSHClient()
        c.set_missing_host_key_policy(paramiko.MissingHostKeyPolicy())
        c.connect(None, username='******', password='******', sock=chan)

        j = RemoteScriptJob(c, 'static/scripts/v3_health_check.py')
        jobsystem.add_job(j)
        jobsystem.run(j.job_id)
        while j.status != JobStatus.STOPPED or j.readable():
            log = j.get_new_log()
            if log.log_type != LogType.START and log.log_type != LogType.END:
                log.progress = self._p
                self._info(log)
Esempio n. 2
0
    def _get_all_arms(self):
        if self._all_arms:
            return self._all_arms

        j = RemoteScriptJob(self._client, 'static/scripts/get_all_arm_ip.py')
        jobsystem.add_job(j)
        jobsystem.run(j.job_id)
        output = []

        while j.status != JobStatus.STOPPED or j.readable():
            msg = j.get_new_log().str.strip()
            if msg != '':
                output.append(msg)

        return output