Пример #1
0
 def run(self):
     pkgs = exs = []
     try:
         pkgs = self.kwargs['package']
     except KeyError:
         pkgs = dapicli.get_installed_daps()
         if pkgs:
             logger.info('Updating all DAP packages ...')
         else:
             logger.info('No installed DAP packages found, nothing to update.')
     for pkg in pkgs:
         logger.info('Updating DAP {pkg} ...'.format(pkg=pkg))
         try:
             updated = dapicli.install_dap(pkg,
                                           update=True,
                                           update_allpaths=self.kwargs['allpaths'],
                                           force=self.kwargs['force'])
             if updated:
                 logger.info('DAP {pkg} successfully updated.'.format(pkg=pkg))
             else:
                 logger.info('DAP {pkg} is already up to date.'.format(pkg=pkg))
         except exceptions.DapiError as e:
             exs.append(utils.exc_as_decoded_string(e))
             logger.error(utils.exc_as_decoded_string(e))
     if exs:
         raise exceptions.ExecutionException('; '.join(exs))
Пример #2
0
 def run(self):
     pkgs = exs = []
     try:
         pkgs = self.kwargs['package']
     except KeyError:
         pkgs = dapicli.get_installed_daps()
         if pkgs:
             logger.info('Updating all DAP packages ...')
         else:
             logger.info(
                 'No installed DAP packages found, nothing to update.')
     for pkg in pkgs:
         logger.info('Updating DAP {pkg} ...'.format(pkg=pkg))
         try:
             updated = dapicli.install_dap(
                 pkg,
                 update=True,
                 update_allpaths=self.kwargs['allpaths'],
                 force=self.kwargs['force'])
             if updated:
                 logger.info(
                     'DAP {pkg} successfully updated.'.format(pkg=pkg))
             else:
                 logger.info(
                     'DAP {pkg} is already up to date.'.format(pkg=pkg))
         except exceptions.DapiError as e:
             exs.append(utils.exc_as_decoded_string(e))
             logger.error(utils.exc_as_decoded_string(e))
     if exs:
         raise exceptions.ExecutionException('; '.join(exs))
Пример #3
0
 def run(cls, **kwargs):
     pkgs = exs = []
     try:
         pkgs = kwargs['package']
     except KeyError:
         logger.info('Updating all packages')
         pkgs = dapicli.get_installed_daps()
     for pkg in pkgs:
         logger.info('Updating {pkg}...'.format(pkg=pkg))
         try:
             dapicli.install_dap(pkg, update=True)
             logger.info('{pkg} successfully updated'.format(pkg=pkg))
         except Exception as e:
             exs.append(str(e))
             logger.error(str(e))
     if exs:
         raise exceptions.ExecutionException('; '.join(exs))
Пример #4
0
 def run(cls, **kwargs):
     pkgs = exs = []
     try:
         pkgs = kwargs['package']
     except KeyError:
         pkgs = dapicli.get_installed_daps()
         if pkgs:
             logger.info('Updating all DAP packages ...')
         else:
             logger.info('No installed DAP packages found, nothing to update.')
     for pkg in pkgs:
         logger.info('Updating DAP {pkg} ...'.format(pkg=pkg))
         try:
             updated = dapicli.install_dap(pkg, update=True, force=kwargs['force'])
             if updated:
                 logger.info('DAP {pkg} successfully updated.'.format(pkg=pkg))
             else:
                 logger.info('DAP {pkg} is already up to date.'.format(pkg=pkg))
         except Exception as e:
             exs.append(str(e))
             logger.error(str(e))
     if exs:
         raise exceptions.ExecutionException('; '.join(exs))