def execute_remote_cmd(remote, cmd, exit_code=0): msg = ( "execute_remote_cmd() is old deprecated method, " "which should not be used anymore. " "please use remote.check_call() instead.\n" "Starting from fuel-devops 2.9.22 this methods will return all " "required data.\n" "{}".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]) return result["stdout"]
def execute_through_host(ssh, vm_host, cmd, creds=()): msg = ( 'execute_throw_host(ssh=SSHClient(), ...) is deprecated ' 'in favor of ' 'SSHClient().execute_through_host(hostname, cmd, auth, ...).\n' '{}'.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'], SSH_IMAGE_CREDENTIALS['password'] ) return ssh.execute_through_host( hostname=vm_host, cmd=cmd, auth=SSHAuth(*creds) )
# # 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 __future__ import absolute_import from traceback import print_stack from warnings import warn from fuelweb_test import logger from core.models.collector_client import CollectorClient msg = ( 'fuelweb_test.models.collector_client is deprecated and will be dropped ' 'on 14.09.2016. Please use core.models.collector_client instead') warn(msg) print_stack() logger.critical(msg) __all__ = ['CollectorClient']
# 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 __future__ import absolute_import from traceback import print_stack from warnings import warn from fuelweb_test import logger from core.models.collector_client import CollectorClient msg = ( 'fuelweb_test.models.collector_client is deprecated and will be dropped ' 'on 14.09.2016. Please use core.models.collector_client instead' ) warn(msg) print_stack() logger.critical(msg) __all__ = ['CollectorClient']