On Mon, 2011-04-18 at 12:30 -0700, Eric Li(李咏竹) wrote: > I need to override the logic to read fetch_location from global_config > with site_autotest implementation. So I refactored it out to its own > function inside server/autotest.py.
LGTM, applied, thanks! http://autotest.kernel.org/changeset/5317 > > Index: server/autotest.py > =================================================================== > --- server/autotest.py (revision 5316) > +++ server/autotest.py (working copy) > @@ -119,6 +119,14 @@ > ', '.join(client_autodir_paths)) > > > + def get_fetch_location(self): > + c = global_config.global_config > + repos = c.get_config_value("PACKAGES", 'fetch_location', > type=list, > + default=[]) > + repos.reverse() > + return repos > + > + > def install(self, host=None, autodir=None): > self._install(host=host, autodir=autodir) > > @@ -133,10 +141,7 @@ > > > def _install_using_packaging(self, host, autodir): > - c = global_config.global_config > - repos = c.get_config_value("PACKAGES", 'fetch_location', > type=list, > - default=[]) > - repos.reverse() > + repos = self.get_fetch_location() > if not repos: > raise error.PackageInstallError("No repos to install an " > "autotest client from") > @@ -361,9 +366,7 @@ > # If the packaging system is being used, add the repository > list. > repos = None > try: > - c = global_config.global_config > - repos = c.get_config_value("PACKAGES", 'fetch_location', > type=list) > - repos.reverse() # high priority packages should be added > last > + repos = self.get_fetch_location() > pkgmgr = packages.PackageManager('autotest', > hostname=host.hostname, > repo_urls=repos) > prologue_lines.append('job.add_repository(%s)\n' % repos) > > -- > Eric Li > 李咏竹 > Google Kirkland > > > > _______________________________________________ > Autotest mailing list > [email protected] > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
