[PATCH][kteam-tools] cve-tracker: add verbose progress reporting, speed up CVE linkage

Brad Figg brad.figg at canonical.com
Thu May 26 18:19:30 UTC 2011


On 05/26/2011 11:16 AM, Kees Cook wrote:
> Progress reporting, replace CVE linkage, fix reported staging URL.
>
> Signed-off-by: Kees Cook<kees.cook at canonical.com>
> ---
>   stable/create-cve-tracker |   27 +++++++++++++++------------
>   1 files changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/stable/create-cve-tracker b/stable/create-cve-tracker
> index a06d6eb..b9d957e 100755
> --- a/stable/create-cve-tracker
> +++ b/stable/create-cve-tracker
> @@ -152,8 +152,10 @@ class CreateCveTracker(StdApp):
>           try:
>               self.merge_config_options(self.defaults, cmdline.process(argv, self.defaults))
>               cmdline.verify_options(self.cfg)
> +            print "Starting up ..."
>               self.initialize()
>
> +            print "Connecting to Launchpad ..."
>               lp = self.lp.launchpad
>
>               # Title: CVE-xxxx-xxxx
> @@ -167,30 +169,29 @@ class CreateCveTracker(StdApp):
>               description = "Placeholder"
>
>               try:
> +                print "Creating bug ..."
>                   bug = self.lp.create_bug(project='ubuntu', package='linux', title=title, description=description)
>
>                   try:
> +                    print "Updating tags ..."
>                       bug.tags.append('kernel-cve-tracking-bug')
>
> +                    print "Marking as security ..."
>                       bug.security_related = True
>
> -                    # Link the appropriate cve to the bug
> -                    #
> -                    found = False
> -                    for cve in self.lp.launchpad.cves:
> -                        if title in cve.display_name:
> -                            found = True
> -                            break
> -                    if found:
> -                        bug.lpbug.linkCVE(cve=cve)
> -
> -                    lp = self.lp.launchpad
> +                    # Link the appropriate cve to the bug.
> +                    # Cannot safely use 'linkCVE' due to LP: #439470
> +                    print "Linking to %s ..." % (title)
> +                    bug.add_comment(content=title)
> +
>                       ubuntu = lp.distributions["ubuntu"]
>                       # Add bug tasks for related source packages
>                       #
>                       pkgs = ['linux-fsl-imx51', 'linux-mvl-dove', 'linux-lts-backport-maverick', 'linux-ti-omap4']
>                       for p in pkgs:
> +                        print "Finding source package '%s' ..." % (p)
>                           pkg = ubuntu.getSourcePackage(name=p)
> +                        print "Adding bug task for '%s' ..." % (p)
>                           t = bug.lpbug.addTask(target=pkg)
>
>                       # Nominate for all active series
> @@ -198,12 +199,14 @@ class CreateCveTracker(StdApp):
>                       sc = ubuntu.series_collection
>                       for s in sc:
>                           if s.active:
> +                            print "Adding nomination for '%s' ..." % (s.name)
>                               nomination = bug.lpbug.addNomination(target=s)
> +                            print "Approving nomination for '%s' ..." % (s.name)
>                               if nomination.canApprove():
>                                   nomination.approve()
>
>                       if 'staging' in self.cfg:
> -                        print("https://bugs.qastaging.launchpad.net/bugs/%s" % (bug.id))
> +                        print("https://qastaging.launchpad.net/bugs/%s" % (bug.id))
>                       else:
>                           print("https://bugs.launchpad.net/bugs/%s" % (bug.id))
>

I don't really care for the additional debugging prints. If you want
to add then as part of a --verbose option, I'd be open to that.

Brad
-- 
Brad Figg brad.figg at canonical.com http://www.canonical.com




More information about the kernel-team mailing list