def _hold_packages(self):
     if shutil.which("apt-mark"):
         packages_to_hold = ' '.join(self.config.PACKAGES_TO_HOLD +
                                     self.hold_ext)
         cmd = compose_cmd(['apt-mark', 'hold', packages_to_hold])
         NodeControlUtil.run_shell_command(cmd)
         logger.info('Successfully put {} packages on hold'.format(
             packages_to_hold))
     else:
         logger.info('Skipping packages holding')
    def _call_upgrade_script(self, pkg_name, version):
        logger.info('Upgrading indy node to version {}, test_mode {}'.format(
            version, int(self.test_mode)))

        deps = self._get_deps_list('{}={}'.format(pkg_name, version))
        deps = '"{}"'.format(deps)

        cmd_file = 'upgrade_indy_node'
        if self.test_mode:
            cmd_file = 'upgrade_indy_node_test'

        cmd = compose_cmd([cmd_file, deps])
        NodeControlUtil.run_shell_command(cmd, timeout=self.timeout)
Exemple #3
0
 def _hold_packages(self):
     if shutil.which("apt-mark"):
         cmd = compose_cmd(['apt-mark', 'hold', self.packages_to_hold])
         ret = NodeControlUtil.run_shell_command(cmd, TIMEOUT)
         if ret.returncode != 0:
             raise Exception('cannot mark {} packages for hold '
                             'since {} returned {}'.format(
                                 self.packages_to_hold, cmd,
                                 ret.returncode))
         logger.info('Successfully put {} packages on hold'.format(
             self.packages_to_hold))
     else:
         logger.info('Skipping packages holding')
Exemple #4
0
 def _hold_packages(self):
     if shutil.which("apt-mark"):
         packages_to_hold = '{} {}'.format(
             ' '.join(self.config.PACKAGES_TO_HOLD), self.hold_ext)
         cmd = compose_cmd(['apt-mark', 'hold', packages_to_hold])
         ret = NodeControlUtil.run_shell_command(cmd, TIMEOUT)
         if ret.returncode != 0:
             raise Exception(
                 'cannot mark {} packages for hold since {} returned {}'.
                 format(packages_to_hold, cmd, ret.returncode))
         logger.info('Successfully put {} packages on hold'.format(
             packages_to_hold))
     else:
         logger.info('Skipping packages holding')
 def _call_restart_node_script(self):
     logger.info('Restarting indy')
     cmd = compose_cmd(['restart_indy_node'])
     NodeControlUtil.run_shell_command(cmd, timeout=self.timeout)