~vbocek/+junk/system-image-server-tasemnice

« back to all changes in this revision

Viewing changes to bin/import-images

  • Committer: Vojtech Bocek
  • Date: 2014-02-27 14:50:39 UTC
  • Revision ID: vbocek@gmail.com-20140227145039-rd5ytc7xzknytn02
Support sync_with channel config option 

* Generates images in sync with another system-image server - when a new
  image is added on remote system-image, an image with same version
  number is generated in this channnel

* Example:
  [channel_trusty]
  ...
  sync_with = https://system-image.ubuntu.com;trusty;flo
  ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
 
132
132
            # Allocate new version number
133
133
            new_version = channel.versionbase
134
 
            if last_full:
 
134
            if channel.sync_with:
 
135
                new_version = tools.get_remote_image_version(channel.sync_with)
 
136
                if last_full and new_version <= last_full['version']:
 
137
                     logging.info("Skipping image build because version on synced "
 
138
                                 "system-image server is same or higher as last "
 
139
                                 "full image (new: %s, curr: %s)" %
 
140
                                 (new_version, last_full['version']))
 
141
                     continue
 
142
            elif last_full:
135
143
                new_version = last_full['version'] + 1
136
144
            logging.debug("Version for next image: %s" % new_version)
137
145