~sil2100/cupstream2distro/additional_check_full_sync

« back to all changes in this revision

Viewing changes to citrain/prepare_silo.py

  • Committer: Tarmac
  • Author(s): Łukasz 'sil2100' Zemczak
  • Date: 2014-09-15 19:38:58 UTC
  • mfrom: (730.1.3 cu2d-syncbothways)
  • Revision ID: tarmac-20140915193858-lll7fcxoluxjchpp
Enable the silo sync functionality (sync:num) to work for both ubuntu and ubuntu-rtm silos, so both ways. In the past it was only for ubuntu -> ubuntu-rtm synces, but now it all depends on what for the sync silo is configured. CI Train also tries to remove the ~rtm version number from the landing when syncing to ubuntu.

Approved by ♫ Robert Bruce Park ♫.

Show diffs side-by-side

added added

removed removed

Lines of Context:
245
245
            if len(split) > 1:
246
246
                source_series = split[1]
247
247
        elif split[0].isdigit():
 
248
            # for silo synces we only handle ubuntu and ubuntu-rtm
 
249
            source_distro = (
 
250
                "ubuntu" if env.DISTRIBUTION == "ubuntu-rtm" else
 
251
                "ubuntu-rtm")
248
252
            source_landing = "landing-{:03d}".format(int(split[0]))
249
253
            source_archive = launchpadmanager.get_ppa(
250
 
                "ci-train-ppa-service/ubuntu/{}".format(source_landing))
251
 
            source_series = "utopic"
 
254
                "ci-train-ppa-service/{}/{}".format(
 
255
                    source_distro,
 
256
                    source_landing))
 
257
            source_series = (
 
258
                "utopic" if env.DISTRIBUTION == "ubuntu-rtm" else
 
259
                "14.09")
252
260
 
253
261
            logging.info(
254
 
                "Sync from a silo (ubuntu/{}) requested".format(
 
262
                "Sync from a silo ({}/{}) requested".format(
 
263
                    source_distro,
255
264
                    source_landing))
256
265
 
257
266
            # read the configuration of the source silo
258
267
            source_config = silomanager.load_config(
259
 
                os.path.join(SILOS_DIR, "ubuntu", source_landing))
 
268
                os.path.join(SILOS_DIR, source_distro, source_landing))
260
269
            if not source_config:
261
270
                logging.error(
262
271
                    "The source silo is either not accessible or not "