~free.ekanayaka/landscape-client/lucid-1.5.2.1-0ubuntu0.10.04.0

« back to all changes in this revision

Viewing changes to landscape/package/changer.py

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Free Ekanayaka
  • Date: 2009-07-22 14:54:50 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090722145450-pvbp13gh8734c8ft
Tags: 1.3.2.2-0ubuntu0.9.10.1
[ Free Ekanayaka ]
* New upstream release:
  - Include the README file in landscape-client (LP: #396260)
  - Fix client capturing stderr from run_command when constructing
    hash-id-databases url (LP: #397480)
  - Use substvars to conditionally depend on update-motd or
    libpam-modules (LP: #393454)
  - Fix reporting wrong version to the server (LP: #391225)
  - The init script does not wait for the network to be available
    before checking for EC2 user data (LP: #383336)
  - When the broker is restarted by the watchdog, the state of the client
    is inconsistent (LP: #380633)
  - Package stays unknown forever in the client with hash-id-databases
    support (LP: #381356)
  - Standard error not captured when calling smart-update (LP: #387441)
  - Changer calls reporter without switching groups, just user (LP: #388092)
  - Run smart update in the package-reporter instead of having a cronjob (LP: #362355)
  - Package changer does not inherit proxy settings (LP: #381241)
  - The ./test script doesn't work in landscape-client (LP: #381613)
  - The source package should build on all supported releases (LP: #385098)
  - Strip smart update's output (LP: #387331)
  - The fetch() timeout isn't based on activity (#389224)
  - Client can use a UUID of "None" when fetching the hash-id-database (LP: #381291)
  - Registration should use the fqdn rather than just the hostname (LP: #385730)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import sys
4
4
import os
5
5
import pwd
 
6
import grp
6
7
 
7
 
from twisted.internet.defer import succeed, fail
 
8
from twisted.internet.defer import fail
8
9
 
9
10
from landscape.package.reporter import find_reporter_command
10
11
from landscape.package.taskhandler import PackageTaskHandler, run_task_handler
42
43
 
43
44
    def run(self):
44
45
        task1 = self._store.get_next_task(self.queue_name)
45
 
        result = super(PackageChanger, self).run()
 
46
 
46
47
        def finished(result):
47
48
            task2 = self._store.get_next_task(self.queue_name)
48
49
            if task1 and task1.id != (task2 and task2.id):
 
50
                # In order to let the reporter run smart-update cleanly,
 
51
                # we have to deinitialize Smart, so that the write lock
 
52
                # gets released
 
53
                self._facade.deinit()
49
54
                if os.getuid() == 0:
 
55
                    os.setgid(grp.getgrnam("landscape").gr_gid)
50
56
                    os.setuid(pwd.getpwnam("landscape").pw_uid)
51
57
                os.system(find_reporter_command())
52
 
        return result.addCallback(finished)
 
58
 
 
59
        result = self.use_hash_id_db()
 
60
        result.addCallback(lambda x: self.handle_tasks())
 
61
        result.addCallback(finished)
 
62
 
 
63
        return result
53
64
 
54
65
    def handle_tasks(self):
55
66
        result = super(PackageChanger, self).handle_tasks()