~ubuntu-branches/ubuntu/lucid/landscape-client/lucid-updates

« back to all changes in this revision

Viewing changes to landscape/package/taskhandler.py

  • Committer: Package Import Robot
  • Author(s): Andreas Hasenack
  • Date: 2012-04-10 14:28:48 UTC
  • mfrom: (1.1.27)
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: package-import@ubuntu.com-20120410142848-7xsy4g2xii7y7ntc
ImportĀ upstreamĀ versionĀ 12.04.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        return os.path.join(self.package_directory, "hash-id")
37
37
 
38
38
    @property
39
 
    def smart_update_stamp_filename(self):
40
 
        """Get the path to the smart-update stamp file."""
41
 
        return os.path.join(self.package_directory, "smart-update-stamp")
 
39
    def update_stamp_filename(self):
 
40
        """Get the path to the update-stamp file."""
 
41
        return os.path.join(self.package_directory, "update-stamp")
42
42
 
43
43
 
44
44
class LazyRemoteBroker(object):
85
85
 
86
86
    queue_name = "default"
87
87
    lsb_release_filename = LSB_RELEASE_FILENAME
 
88
    package_store_class = PackageStore
88
89
 
89
90
    def __init__(self, package_store, package_facade, remote_broker, config):
90
91
        self._store = package_store
211
212
                return None
212
213
 
213
214
            arch = self._facade.get_arch()
214
 
            if arch is None:
215
 
                # The Smart code should always return a proper string, so this
216
 
                # branch shouldn't get executed at all. However this check is
217
 
                # kept as an extra paranoia sanity check.
 
215
            if not arch:
 
216
                # The Apt code should always return a non-empty string,
 
217
                # so this branch shouldn't get executed at all. However
 
218
                # this check is kept as an extra paranoia sanity check.
218
219
                logging.warning(warning % "unknown dpkg architecture")
219
220
                return None
220
221
 
257
258
    # 0644 so...
258
259
    os.umask(022)
259
260
 
260
 
    # Delay importing of the facade so that we don't
 
261
    package_store = cls.package_store_class(config.store_filename)
 
262
    # Delay importing of the facades so that we don't
261
263
    # import Smart unless we need to.
262
 
    from landscape.package.facade import SmartFacade
263
 
 
264
 
    package_store = PackageStore(config.store_filename)
265
 
    package_facade = SmartFacade()
 
264
    from landscape.package.facade import (
 
265
        AptFacade, SmartFacade, has_new_enough_apt)
 
266
    if  has_new_enough_apt:
 
267
        package_facade = AptFacade()
 
268
    else:
 
269
        package_facade = SmartFacade()
266
270
 
267
271
    def finish():
268
272
        connector.disconnect()