Пример #1
0
    def upload_packages(self, local_packages_dir, centos_repo_path,
                        ubuntu_repo_path, clean_target=False):
        logger.info("Upload fuel's packages from directory {0}."
                    .format(local_packages_dir))

        centos_files_count = 0
        ubuntu_files_count = 0

        if centos_repo_path:
            centos_files_count = self.ssh_manager.cond_upload(
                ip=self.admin_ip,
                source=local_packages_dir,
                target=os.path.join(centos_repo_path, 'Packages'),
                condition="(?i).*\.rpm$",
                clean_target=clean_target
            )
            if centos_files_count > 0:
                regenerate_centos_repo(centos_repo_path)

        if ubuntu_repo_path:
            ubuntu_files_count = self.ssh_manager.cond_upload(
                ip=self.admin_ip,
                source=local_packages_dir,
                target=os.path.join(ubuntu_repo_path, 'pool/main'),
                condition="(?i).*\.deb$",
                clean_target=clean_target
            )
            if ubuntu_files_count > 0:
                regenerate_ubuntu_repo(ubuntu_repo_path)

        return centos_files_count, ubuntu_files_count
Пример #2
0
    def upload_packages(self, local_packages_dir, centos_repo_path,
                        ubuntu_repo_path, clean_target=False):
        logger.info("Upload fuel's packages from directory {0}."
                    .format(local_packages_dir))

        centos_files_count = 0
        ubuntu_files_count = 0

        if centos_repo_path:
            centos_files_count = self.ssh_manager.cond_upload(
                ip=self.admin_ip,
                source=local_packages_dir,
                target=os.path.join(centos_repo_path, 'Packages'),
                condition="(?i).*\.rpm$",
                clean_target=clean_target
            )
            if centos_files_count > 0:
                regenerate_centos_repo(centos_repo_path)

        if ubuntu_repo_path:
            ubuntu_files_count = self.ssh_manager.cond_upload(
                ip=self.admin_ip,
                source=local_packages_dir,
                target=os.path.join(ubuntu_repo_path, 'pool/main'),
                condition="(?i).*\.deb$",
                clean_target=clean_target
            )
            if ubuntu_files_count > 0:
                regenerate_ubuntu_repo(ubuntu_repo_path)

        return centos_files_count, ubuntu_files_count
Пример #3
0
    def upload_packages(self, local_packages_dir, centos_repo_path,
                        ubuntu_repo_path):
        logger.info("Upload fuel's packages from directory {0}.".format(
            local_packages_dir))
        centos_files_count = cond_upload(
            self.admin_remote, local_packages_dir,
            os.path.join(centos_repo_path, 'Packages'), "(?i).*\.rpm$")

        ubuntu_files_count = cond_upload(
            self.admin_remote, local_packages_dir,
            os.path.join(ubuntu_repo_path, 'pool/main'), "(?i).*\.deb$")

        if centos_files_count > 0:
            regenerate_centos_repo(self.admin_remote, centos_repo_path)
        if ubuntu_files_count > 0:
            regenerate_ubuntu_repo(self.admin_remote, ubuntu_repo_path)
        return centos_files_count, ubuntu_files_count
Пример #4
0
    def upload_packages(self, local_packages_dir, centos_repo_path,
                        ubuntu_repo_path):
        logger.info("Upload fuel's packages from directory {0}."
                    .format(local_packages_dir))
        centos_files_count = cond_upload(
            self.admin_remote, local_packages_dir,
            os.path.join(centos_repo_path, 'Packages'),
            "(?i).*\.rpm$")

        ubuntu_files_count = cond_upload(
            self.admin_remote, local_packages_dir,
            os.path.join(ubuntu_repo_path, 'pool/main'),
            "(?i).*\.deb$")

        if centos_files_count > 0:
            regenerate_centos_repo(self.admin_remote, centos_repo_path)
        if ubuntu_files_count > 0:
            regenerate_ubuntu_repo(self.admin_remote, ubuntu_repo_path)
        return centos_files_count, ubuntu_files_count