Remove fix for custom field in release metadata
Remove the script that patches custom field in the release metadata from
the code tree.
This script was requried for upgrade of customized version of 5.1.1
release of Fuel. Since that version is no longer supported, the fix
is also not used anymore.
We still need to prepare for later patching of a node's metadata by
moving other scripts and patches to the location where they are expected
to be.
Change-Id: Ifb2590f96449716db09219240ceda6738951f95b
Related-bug: 1574624
(cherry picked from commit 762d70e61d
)
This commit is contained in:
parent
7d4b4955c9
commit
9560431efc
|
@ -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')
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue