SingletonMeta class is exists in fuel-devops: deprecate copy

SingletonMeta class is exists in fuel-devops: deprecate copy
all imports has been changed to devops side
Announce drop of deprecated and already unused helpers.

Change-Id: I98311de2c4fc579b8d6095bf5decd28940a00f88
This commit is contained in:
Alexey Stepanov 2016-08-25 08:37:52 +03:00
parent 5efc65b458
commit eb18c17903
6 changed files with 31 additions and 10 deletions

View File

@ -12,6 +12,16 @@
# License for the specific language governing permissions and limitations
# under the License.
from warnings import warn
warn(
'fuelweb_test.helpers.metaclasses.SingletonMeta is deprected:'
'class is moved to devops.helpers.metaclasses.\n'
'Due to it was single metaclass in file, this file will be deleted in a'
'short time!',
DeprecationWarning
)
class SingletonMeta(type):
"""Metaclass for Singleton

View File

@ -378,6 +378,9 @@ class OpenStackActions(common.Common):
'{}'.format("".join(traceback.format_stack())))
warn(msg, DeprecationWarning)
logger.warning(msg)
logger.critical(
'This method could be deleted on 01.09.2016 '
'without any announcement!')
if not creds:
creds = (
SSH_IMAGE_CREDENTIALS['username'],

View File

@ -20,17 +20,16 @@ import traceback
from warnings import warn
from devops.helpers.helpers import wait
from devops.helpers.metaclasses import SingletonMeta
from devops.models.node import SSHClient
from paramiko import RSAKey
import six
import yaml
from fuelweb_test import logger
from fuelweb_test.helpers.metaclasses import SingletonMeta
@six.add_metaclass(SingletonMeta)
class SSHManager(object):
class SSHManager(six.with_metaclass(SingletonMeta, object)):
def __init__(self):
logger.debug('SSH_MANAGER: Run constructor SSHManager')

View File

@ -16,6 +16,7 @@ from __future__ import division
import copy
# pylint: disable=no-name-in-module
# noinspection PyUnresolvedReferences
from distutils import version
# pylint: enable=no-name-in-module
import inspect
@ -35,9 +36,11 @@ from proboscis import asserts
from proboscis.asserts import assert_true
from proboscis.asserts import assert_equal
# pylint: disable=import-error
# noinspection PyUnresolvedReferences
from six.moves import configparser
# pylint: enable=import-error
# pylint: disable=redefined-builtin
# noinspection PyUnresolvedReferences
from six.moves import xrange
# pylint: enable=redefined-builtin
import yaml
@ -464,6 +467,8 @@ def run_on_remote(*args, **kwargs):
'{}'.format("".join(traceback.format_stack())))
warn(msg, DeprecationWarning)
logger.warning(msg)
logger.critical(
'This method could be deleted on 01.09.2016 without any announcement!')
if 'jsonify' in kwargs:
if kwargs['jsonify']:
return run_on_remote_get_results(*args, **kwargs)['stdout_json']
@ -495,6 +500,8 @@ def run_on_remote_get_results(remote, cmd, clear=False, err_msg=None,
'{}'.format("".join(traceback.format_stack())))
warn(msg, DeprecationWarning)
logger.warning(msg)
logger.critical(
'This method could be deleted on 01.09.2016 without any announcement!')
if assert_ec_equal is None:
assert_ec_equal = [0]
orig_result = remote.check_call(
@ -716,8 +723,8 @@ def generate_floating_ranges(start_ip, end_ip, step):
def get_node_hiera_roles(remote):
"""Get hiera roles assigned to host
:param :remote: SSHClient to node
:rtype: dict host plus role
:param remote: SSHClient to node
:rtype: dict host plus role
"""
cmd = 'hiera roles'
roles = remote.check_call(cmd).stdout_str
@ -1119,7 +1126,7 @@ def get_file_size(ip, file_name, file_path):
def get_quantity_of_numa(ip):
"""Get number of NUMA nodes that are contained on remote node
:param remote: node IP
:param ip: node IP
:return: int, count of available NUMA nodes on the node
"""

View File

@ -21,6 +21,7 @@ from warnings import warn
from devops.helpers.helpers import tcp_ping_
from devops.helpers.helpers import wait_pass
from devops.helpers.helpers import wait
from devops.helpers.metaclasses import SingletonMeta
from devops.helpers.ntp import sync_time
from devops.models import Environment
from keystoneauth1 import exceptions
@ -31,7 +32,6 @@ import six
from fuelweb_test.helpers.decorators import revert_info
from fuelweb_test.helpers.decorators import update_rpm_packages
from fuelweb_test.helpers.decorators import upload_manifests
from fuelweb_test.helpers.metaclasses import SingletonMeta
from fuelweb_test.helpers.eb_tables import Ebtables
from fuelweb_test.helpers.fuel_actions import AdminActions
from fuelweb_test.helpers.fuel_actions import BaseActions
@ -53,8 +53,7 @@ from fuelweb_test import QuietLogger
from fuelweb_test import logger
@six.add_metaclass(SingletonMeta)
class EnvironmentModel(object):
class EnvironmentModel(six.with_metaclass(SingletonMeta, object)):
"""EnvironmentModel.""" # TODO documentation
def __init__(self, config=None):
@ -740,6 +739,9 @@ class EnvironmentModel(object):
'{}'.format("".join(traceback.format_stack())))
warn(msg, DeprecationWarning)
logger.warning(msg)
logger.critical(
'This method could be deleted on 01.09.2016 '
'without any announcement!')
result = remote.check_call(
command=cmd,
expected=[exit_code],

View File

@ -14,12 +14,12 @@
import re
from devops.helpers.metaclasses import SingletonMeta
import proboscis.core
from proboscis import factory
from proboscis.decorators import DEFAULT_REGISTRY
from six import add_metaclass
from fuelweb_test.helpers.metaclasses import SingletonMeta
from system_test.tests import ActionTest
from system_test.core.discover import config_filter