~psusi/ubuntu/raring/landscape-client/fix-memory-report

« back to all changes in this revision

Viewing changes to landscape/package/changer.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2010-07-28 08:14:02 UTC
  • mto: (45.1.1 landscape-client-12.05-0ubuntu1)
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: james.westby@ubuntu.com-20100728081402-kiek53kn178sueqw
Tags: upstream-1.5.4
ImportĀ upstreamĀ versionĀ 1.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
from twisted.internet.defer import maybeDeferred, succeed
10
10
 
 
11
from landscape.constants import (
 
12
    SUCCESS_RESULT, ERROR_RESULT, DEPENDENCY_ERROR_RESULT, POLICY_STRICT,
 
13
    POLICY_ALLOW_INSTALLS, POLICY_ALLOW_ALL_CHANGES,
 
14
    UNKNOWN_PACKAGE_DATA_TIMEOUT)
 
15
 
11
16
from landscape.lib.fs import create_file
12
17
from landscape.package.reporter import find_reporter_command
13
18
from landscape.package.taskhandler import (
16
21
from landscape.manager.manager import SUCCEEDED
17
22
 
18
23
 
19
 
SUCCESS_RESULT = 1
20
 
ERROR_RESULT = 100
21
 
DEPENDENCY_ERROR_RESULT = 101
22
 
POLICY_STRICT = 0
23
 
POLICY_ALLOW_INSTALLS = 1
24
 
POLICY_ALLOW_ALL_CHANGES = 2
25
 
 
26
 
# The amount of time to wait while we have unknown package data before
27
 
# reporting an error to the server in response to an operation.
28
 
# The two common cases of this are:
29
 
# 1.  The server requested an operation that we've decided requires some
30
 
# dependencies, but we don't know the package ID of those dependencies.  It
31
 
# should only take a bit more than 10 minutes for that to be resolved by the
32
 
# package reporter.
33
 
# 2.  We lost some package data, for example by a deb archive becoming
34
 
# inaccessible for a while.  The earliest we can reasonably assume that to be
35
 
# resolved is in 60 minutes, when the smart cronjob runs again.
36
 
 
37
 
# So we'll give the problem one chance to resolve itself, by only waiting for
38
 
# one run of smart update.
39
 
UNKNOWN_PACKAGE_DATA_TIMEOUT = 70 * 60
40
 
 
41
 
 
42
24
class UnknownPackageData(Exception):
43
25
    """Raised when an ID or a hash isn't known."""
44
26