Revision e2dc37b2 ci/utils.py
b/ci/utils.py | ||
---|---|---|
520 | 520 |
_run(cmd, True) |
521 | 521 |
|
522 | 522 |
@_check_fabric |
523 |
def fetch_packages(self): |
|
523 |
def fetch_packages(self, dest=None):
|
|
524 | 524 |
"""Download Synnefo packages""" |
525 | 525 |
self.logger.info("Download Synnefo packages") |
526 | 526 |
self.logger.debug("Create tarball with packages") |
... | ... | |
529 | 529 |
""" |
530 | 530 |
_run(cmd, False) |
531 | 531 |
|
532 |
pkgs_dir = self.config.get('Global', 'pkgs_dir') |
|
532 |
if dest is None: |
|
533 |
pkgs_dir = self.config.get('Global', 'pkgs_dir') |
|
534 |
else: |
|
535 |
pkgs_dir = dest |
|
536 |
|
|
533 | 537 |
self.logger.debug("Fetch packages to local dir %s" % pkgs_dir) |
534 |
os.makedirs(pkgs_dir) |
|
538 |
# Create package directory if missing |
|
539 |
if not os.path.exists(pkgs_dir): |
|
540 |
os.makedirs(pkgs_dir) |
|
541 |
|
|
535 | 542 |
with fabric.quiet(): |
536 | 543 |
fabric.get("synnefo_build-area.tgz", pkgs_dir) |
537 | 544 |
|
... | ... | |
539 | 546 |
self._check_hash_sum(pkgs_file, "synnefo_build-area.tgz") |
540 | 547 |
|
541 | 548 |
self.logger.debug("Untar packages file %s" % pkgs_file) |
542 |
os.system("cd %s; tar xzf synnefo_build-area.tgz" % pkgs_dir) |
|
549 |
cmd = """ |
|
550 |
cd %s |
|
551 |
tar xzf synnefo_build-area.tgz |
|
552 |
cp synnefo_build-area/* %s |
|
553 |
rm -r synnefo_build-area |
|
554 |
""" % (pkgs_dir, dest) |
|
555 |
os.system(cmd) |
|
543 | 556 |
self.logger.info("Downloaded debian packages to %s" % |
544 | 557 |
_green(pkgs_dir)) |
Also available in: Unified diff