Nice find Jelmer. It's a shame (but not a surprise :/), that we don't seem to have a test for the sourcepackagenames_only option. It's only referenced in the config. Steve, feel free to add one before fixing the issue :) Actually, I can't see it referenced anywhere in the lp-production-configs? Do we even use it? (if not, we could remove it).
Or another option, if you rename your var 'list_source' to simply 'source_list', then you can create your source_lists prior to the iteration (for source_list in source_lists:). See what you think.
Hi Steve and Jelmer,
Nice find Jelmer. It's a shame (but not a surprise :/), that we don't seem to have a test for the sourcepackagena mes_only option. It's only referenced in the config. Steve, feel free to add one before fixing the issue :) Actually, I can't see it referenced anywhere in the lp-production- configs? Do we even use it? (if not, we could remove it).
I've just got a few style questions below.
Thanks for the fix!
> === modified file 'lib/lp/ soyuz/scripts/ gina/archive. py' soyuz/scripts/ gina/archive. py 2009-06-25 04:06:00 +0000 soyuz/scripts/ gina/archive. py 2010-03-17 11:15:37 +0000 "Invalid Sources stanza in %s" % sources_ tagfile) map[src_ name] = src_tmp map.setdefault( src_name, []).append(src_tmp)
> --- lib/lp/
> +++ lib/lp/
> @@ -207,7 +207,7 @@
> log.exception(
> info_set.
> continue
> - self.src_
> + self.src_
Not sure what you prefer, but I think this is more readable like this:
http:// pastebin. ubuntu. com/399865/
which also passes the test. Up to you.
> === modified file 'scripts/gina.py' map.src_ map) packages_ map.src_ map.values( ), get("Package" , "unknown") packages_ map.src_ map.values( ), "Package" )):
> --- scripts/gina.py 2009-10-13 14:38:07 +0000
> +++ scripts/gina.py 2010-03-17 11:15:37 +0000
> @@ -229,44 +229,45 @@
> npacks = len(packages_
> log.info('%i Source Packages to be imported' % npacks)
>
> - for source in sorted(
> - key=lambda x: x.get("Package")):
> - count += 1
> - package_name = source.
> - try:
> + for list_source in sorted(
> + key=lambda x: x[0].get(
The python style guide used to allow the previous indentation, but it now should be:
for list_source in sorted(
packages_ map.src_ map.values( ), key=lambda x: x[0].get( "Package" )):
See https:/ /dev.launchpad. net/PythonStyle Guide#Multiline %20function% 20calls
Or another option, if you rename your var 'list_source' to simply 'source_list', then you can create your source_lists prior to the iteration (for source_list in source_lists:). See what you think.
> + for source in list_source: get("Package" , "unknown") sourcepackage( source, kdb, package_root, keyrings, sourcepackage( source, kdb, package_root, keyrings,
> + count += 1
> + package_name = source.
> try:
> - do_one_
> + try:
> + do_one_
> importer_handler)
Similar, if you need to wrap the args to a fn call, they should start on the next line.
> - except psycopg2.Error: "Database error: unable to create " "Database error: unable to create "
> - log.exception(
> + except psycopg2.Error:
> + log.exception(
> "SourcePackage for %s. Retrying once.."
> % package_name)
And again.
> - importer_ handler. abort() sourcepackage( source, kdb, package_root, keyrings, handler. abort() sourcepackage( source, kdb, package_root, keyrings,
> - time.sleep(15)
> - do_one_
> + importer_
> + time.sleep(15)
> + do_one_
> importer_handler)
Here too.
> - except (InvalidVersion Error, MissingRequired Arguments, Error, MissingRequired Arguments, dingError) : "Unable to create SourcePackageData for %s" % "Error processing package files for %s" % "Database errors made me give up: unable to create " "Unable to create SourcePackageData for %s" %
> + except (InvalidVersion
> DisplayNameDeco
> - log.exception(
> - package_name)
> - continue
> - except (PoolFileNotFound, ExecutionError):
> - # Problems with katie db stuff of opening files
> - log.exception(
> - package_name)
> - continue
> - except psycopg2.Error:
> - log.exception(
> + log.exception(
> + package_name)
Ditto.
> + continue "Error processing package files for %s" %
> + except (PoolFileNotFound, ExecutionError):
> + # Problems with katie db stuff of opening files
> + log.exception(
> + package_name)
Ditto.
> + continue "Database errors made me give up: unable to create " handler. abort() ReleaseError: "Database duplication processing %s" % handler. abort() ReleaseError: "Database duplication processing %s" %
> + except psycopg2.Error:
> + log.exception(
> "SourcePackage for %s" % package_name)
> - importer_
> - continue
> - except MultiplePackage
> - log.exception(
> + importer_
> + continue
> + except MultiplePackage
> + log.exception(
> package_name)
Ditto.
> - continue sourcepackage( source, kdb, package_root, keyrings,
> + continue
>
> - if COUNTDOWN and count % COUNTDOWN == 0:
> - log.warn('%i/%i sourcepackages processed' % (count, npacks))
> + if COUNTDOWN and count % COUNTDOWN == 0:
> + log.warn('%i/%i sourcepackages processed' % (count, npacks))
>
>
> def do_one_
>
>