Separate uploading packages for patching

- RPM packages are uploaded after Fuel admin node bootstrapped,
  as previous;
- DEB packages are uploaded after Fuel admin node deployed and
  'auxiliary' repository initialized.

Change-Id: I5c423529e175ef6ddfc9ac5f5e2359e1e0b6d32f
Closes-Bug:#1502242
This commit is contained in:
Dennis Dmitriev 2015-10-13 18:39:58 +03:00
parent 2b7ce18e79
commit a8c4492e12
3 changed files with 30 additions and 16 deletions

View File

@ -164,7 +164,7 @@ def upload_manifests(func):
return wrapper
def update_packages(func):
def update_rpm_packages(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
@ -199,7 +199,7 @@ def update_packages(func):
environment.admin_actions.upload_packages(
local_packages_dir=settings.UPDATE_FUEL_PATH,
centos_repo_path=settings.LOCAL_MIRROR_CENTOS,
ubuntu_repo_path=settings.LOCAL_MIRROR_UBUNTU)
ubuntu_repo_path=None)
if centos_files_count == 0:
return result

View File

@ -292,20 +292,26 @@ class AdminActions(BaseActions):
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$")
centos_files_count = 0
ubuntu_files_count = 0
if centos_repo_path:
centos_files_count = cond_upload(
self.admin_remote, local_packages_dir,
os.path.join(centos_repo_path, 'Packages'),
"(?i).*\.rpm$")
if centos_files_count > 0:
regenerate_centos_repo(self.admin_remote, centos_repo_path)
if ubuntu_repo_path:
ubuntu_files_count = cond_upload(
self.admin_remote, local_packages_dir,
os.path.join(ubuntu_repo_path, 'pool/main'),
"(?i).*\.deb$")
if ubuntu_files_count > 0:
regenerate_ubuntu_repo(self.admin_remote, ubuntu_repo_path)
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
@logwrap

View File

@ -27,7 +27,7 @@ from proboscis.asserts import assert_true
from fuelweb_test.helpers import checkers
from fuelweb_test.helpers.decorators import revert_info
from fuelweb_test.helpers.decorators import retry
from fuelweb_test.helpers.decorators import update_packages
from fuelweb_test.helpers.decorators import update_rpm_packages
from fuelweb_test.helpers.decorators import upload_manifests
from fuelweb_test.helpers.eb_tables import Ebtables
from fuelweb_test.helpers.fuel_actions import AdminActions
@ -387,6 +387,14 @@ class EnvironmentModel(object):
self.admin_actions.modify_configs(self.d_env.router())
self.kill_wait_for_external_config()
self.wait_bootstrap()
if settings.UPDATE_FUEL:
# Update Ubuntu packages
self.admin_actions.upload_packages(
local_packages_dir=settings.UPDATE_FUEL_PATH,
centos_repo_path=None,
ubuntu_repo_path=settings.LOCAL_MIRROR_UBUNTU)
self.docker_actions.wait_for_ready_containers()
time.sleep(10)
self.set_admin_keystone_password()
@ -424,7 +432,7 @@ class EnvironmentModel(object):
"xargs -n1 -i sed '$aenabled=0' -i {}"
self.execute_remote_cmd(remote, cmd)
@update_packages
@update_rpm_packages
@upload_manifests
def setup_customisation(self):
logger.info('Installing custom packages/manifests '