def update(self): stdout, stderr = ssh_cmd( self.host, self.host_args, 'sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q' ' -o Dpkg::Options::=--force-confold upgrade;') if stderr != "": return False autoremove = jinja(self.updater_args.get('autoremove', False)) if autoremove: stdout, stderr = ssh_cmd( self.host, self.host_args, 'sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q' ' -o Dpkg::Options::=--force-confold autoremove;') if stderr != "": return False patchman_url = self.updater_args.get('patchman-url') if patchman_url.startswith('https'): https_proxy = self.updater_args.get('https_proxy') proxy_prefix = 'export https_proxy={}; '.format( https_proxy) if https_proxy else '' else: http_proxy = self.updater_args.get('http_proxy') proxy_prefix = 'export http_proxy={}; '.format( http_proxy) if http_proxy else '' if patchman_url is not None: ssh_cmd( self.host, self.host_args, '{}sudo patchman-client -s {}'.format(proxy_prefix, patchman_url)) return True
def update(self): if self.command: command = jinja(self.command, host=self.host, host_args=self.host_args) ssh_cmd(self.host, self.host_args, command) return True return False
def update(self): ssh_cmd(self.host, self.host_args, 'sudo reboot') if not self.wait: log.debug('[{}] Not waiting for reboot'.format(self.host)) return True now = datetime.now() timeout = now + timedelta(seconds=self.wait_timeout) success = False while not success and datetime.now() <= timeout: log.debug('[{}] Waiting for reboot...'.format(self.host)) success = ssh_try_connect(self.host, self.host_args, timeout=self.wait_check_interval) if not success: log.fatal('[{}] Timeout waiting for reboot'.format(self.host)) return success
def update(self): fname = self.updater_args.get('filename', '.silently.updated') stdout, stderr = ssh_cmd(self.host, self.host_args, 'touch {}'.format(fname)) return stderr == ""