diff --git a/octane/commands/upgrade_node.py b/octane/commands/upgrade_node.py index 1d885008..8cc53d63 100644 --- a/octane/commands/upgrade_node.py +++ b/octane/commands/upgrade_node.py @@ -14,12 +14,10 @@ import logging import os.path from cliff import command as cmd -from distutils import version from fuelclient.objects import environment as environment_obj from fuelclient.objects import node as node_obj from octane.handlers import upgrade as upgrade_handlers -from octane.helpers import disk from octane import magic_consts from octane.util import docker from octane.util import env as env_util @@ -48,7 +46,10 @@ def upgrade_node(env_id, node_ids, isolated=False, network_template=None): orig_id, one_orig_id, ) one_orig_id = orig_id - patch_partition_generator(one_orig_id) + # NOTE(ogelbukh): patches and scripts copied to nailgun container + # for later use + copy_patches_folder_to_nailgun() + call_handlers = upgrade_handlers.get_nodes_handlers(nodes, env, isolated) call_handlers('preupgrade') call_handlers('prepare') @@ -63,16 +64,6 @@ def upgrade_node(env_id, node_ids, isolated=False, network_template=None): call_handlers('postdeploy') -def patch_partition_generator(env_id): - """Update partitions generator for releases earlier than 6.0""" - - env = environment_obj.Environment(env_id) - env_version = version.StrictVersion(env.data["fuel_version"]) - if env_version < version.StrictVersion("6.0"): - copy_patches_folder_to_nailgun() - disk.update_partition_generator() - - def copy_patches_folder_to_nailgun(): dest_folder = '/tmp' folder = os.path.join(magic_consts.CWD, 'patches') diff --git a/octane/helpers/disk.py b/octane/helpers/disk.py index 387ec1cc..ca0e58d5 100644 --- a/octane/helpers/disk.py +++ b/octane/helpers/disk.py @@ -39,12 +39,6 @@ def create_partition(disk_name, size, node): node=node) -def update_partition_generator(): - fname = 'update_release_partition_info.py' - command = ['python', os.path.join('/tmp', fname)] - docker.run_in_container('nailgun', command) - - def update_node_partition_info(node_id): fname = 'update_node_partition_info.py' command = ['python', os.path.join('/tmp', fname), str(node_id)] diff --git a/octane/patches/update_release_partition_info.py b/octane/patches/update_release_partition_info.py deleted file mode 100644 index 967ff86a..00000000 --- a/octane/patches/update_release_partition_info.py +++ /dev/null @@ -1,26 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from nailgun.db import db -from nailgun.db.sqlalchemy import models - -releases = db().query(models.Release) -for rel in releases: - meta = rel.volumes_metadata - for volume in meta['volumes']: - if volume['min_size']['generator'] == 'calc_min_log_size': - volume['min_size']['generator'] = 'calc_gb_to_mb' - volume['min_size']['generator_args'] = [2] - db().query(models.Release).filter_by(id=rel.id).update( - {"volumes_metadata": meta}) - -db().commit()