Пример #1
0
 def setUp(self):
     super(GooGetTest, self).setUp()
     self.install = googet.GooGetInstall()
     self.buildinfo = buildinfo.BuildInfo()
     self.flags = [
         'whatever', '-reinstall', 'http://example.com/team-%',
         r'http://example.co.uk/secure-%\%', r'http://%.jp/%\%'
     ]
Пример #2
0
    def Run(self):
        for args in self._args:
            # Default to just the package being required
            if len(args) > 1:
                flags = args[1]
            else:
                flags = None

            if len(args) > 2:
                path = args[2]
            else:
                path = None

            if len(args) > 3:
                retries = int(args[3])
            else:
                retries = 5

            if len(args) > 4:
                sleep = int(args[4])
            else:
                sleep = 30

            try:
                logging.info('Invoking GooGet with args %s', args)
                install = googet.GooGetInstall()
                install.LaunchGooGet(pkg=args[0],
                                     retries=retries,
                                     sleep=sleep,
                                     build_info=self._build_info,
                                     path=path,
                                     flags=flags)
            except googet.Error as e:
                raise ActionError(
                    "Failure executing GooGet command with error: '%s'" % e)
            except IndexError:
                raise ActionError(
                    "Unable to access all required arguments in command "
                    "'%s'" % str(args))