Add exec support

master
root 2022-12-01 18:08:42 +00:00
parent f8cbbe3703
commit 51304e3426
1 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,13 @@ def check_channel_shell_request(self, channel):
return True return True
def check_channel_exec_request(self, channel):
logger.debug("Check channel exec request: %s" % channel.get_id())
self.runner.set_shell_channel(channel)
return True
def check_channel_subsystem_request(self, channel, name): def check_channel_subsystem_request(self, channel, name):
if name == 'sftp': if name == 'sftp':
self.runner.set_sftp_channel(channel) self.runner.set_sftp_channel(channel)
@ -81,6 +88,7 @@ class Runner(threading.Thread):
client_sftp_channel = ssh_client.open_sftp().get_channel() client_sftp_channel = ssh_client.open_sftp().get_channel()
last_save_time = round(time.time()) last_save_time = round(time.time())
lxd_interface.set_description(self.instance_name, str(last_save_time))
while True: while True:
current_time_rounded = round(time.time()) current_time_rounded = round(time.time())
if current_time_rounded != last_save_time: if current_time_rounded != last_save_time: