def getObsoleter(self,
                     suite='warty',
                     distribution='ubuntu',
                     confirm_all=True):
        """Return an ObsoleteDistroseries instance.

        Allow tests to use a set of default options and pass an
        inactive logger to ObsoleteDistroseries.
        """
        test_args = [
            '-s',
            suite,
            '-d',
            distribution,
        ]

        if confirm_all:
            test_args.append('-y')

        obsoleter = ObsoleteDistroseries(name='obsolete-distroseries',
                                         test_args=test_args)
        # Swallow all log messages.
        obsoleter.logger = DevNullLogger()
        obsoleter.setupLocation()
        return obsoleter
    def getObsoleter(self, suite='warty', distribution='ubuntu',
                     confirm_all=True):
        """Return an ObsoleteDistroseries instance.

        Allow tests to use a set of default options and pass an
        inactive logger to ObsoleteDistroseries.
        """
        test_args = [
            '-s', suite,
            '-d', distribution,
            ]

        if confirm_all:
            test_args.append('-y')

        obsoleter = ObsoleteDistroseries(
            name='obsolete-distroseries', test_args=test_args)
        # Swallow all log messages.
        obsoleter.logger = DevNullLogger()
        obsoleter.setupLocation()
        return obsoleter
#!/usr/bin/python -S
#
# Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

"""Obsolete all packages in an obsolete distroseries.

This script will obsolete (schedule for removal) all published packages
in an obsolete distroseries.
"""

import _pythonpath

from lp.services.config import config
from lp.soyuz.scripts.obsolete_distroseries import ObsoleteDistroseries


if __name__ == '__main__':
    script = ObsoleteDistroseries(
        'obsolete-distroseries', dbuser=config.archivepublisher.dbuser)
    script.lock_and_run()
Exemplo n.º 4
0
#!/usr/bin/python -S
#
# Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Obsolete all packages in an obsolete distroseries.

This script will obsolete (schedule for removal) all published packages
in an obsolete distroseries.
"""

import _pythonpath

from lp.services.config import config
from lp.soyuz.scripts.obsolete_distroseries import ObsoleteDistroseries

if __name__ == '__main__':
    script = ObsoleteDistroseries('obsolete-distroseries',
                                  dbuser=config.archivepublisher.dbuser)
    script.lock_and_run()