diff --git a/fuelweb_test/helpers/os_actions.py b/fuelweb_test/helpers/os_actions.py index c8450e706..83c1ab7c5 100644 --- a/fuelweb_test/helpers/os_actions.py +++ b/fuelweb_test/helpers/os_actions.py @@ -131,7 +131,7 @@ class OpenStackActions(common.Common): image_id = self._get_cirros_image().id security_group[self.keystone.tenant_id] =\ self.create_sec_group_for_ssh() - security_group = [security_group[self.keystone.tenant_id].name] + security_groups = [security_group[self.keystone.tenant_id].name] if neutron: net_label = label if label else 'net04' @@ -139,9 +139,9 @@ class OpenStackActions(common.Common): if net.label == net_label] kwargs.update({'nics': [{'net-id': network[0]}], - 'security_groups': security_group}) + 'security_groups': security_groups}) else: - kwargs.update({'security_groups': security_group}) + kwargs.update({'security_groups': security_groups}) srv = self.nova.servers.create(name=name, image=image_id, diff --git a/fuelweb_test/helpers/patching.py b/fuelweb_test/helpers/patching.py index 96d8531b8..e3675d2bf 100644 --- a/fuelweb_test/helpers/patching.py +++ b/fuelweb_test/helpers/patching.py @@ -431,7 +431,7 @@ def verify_fix_apply_step(apply_step): def validate_fix_apply_step(apply_step, environment, slaves): verify_fix_apply_step(apply_step) slaves = [] if not slaves else slaves - command = '' + command = '', remotes_ips = set() devops_action = '' devops_nodes = set() @@ -472,9 +472,10 @@ def validate_fix_apply_step(apply_step, environment, slaves): "service isn't specified".format(apply_step['id'], apply_step['type'])) action = apply_step['type'].split('service_')[1] - command = ("find /etc/init.d/ -regex '/etc/init.d/{service}' -printf " - "'%f\n' -quit | xargs -i service {{}} {action}").format( - service=apply_step['service'], action=action) + command = ( + "find /etc/init.d/ -regex '/etc/init.d/{service}' -printf " + "'%f\n' -quit | xargs -i service {{}} {action}".format( + service=apply_step['service'], action=action), ) elif apply_step['type'] in ('server_down', 'server_up', 'server_reboot'): assert_true('master' not in apply_step['target'], 'Action type "{0}" doesn\'t accept "master" node as ' @@ -498,12 +499,12 @@ def validate_fix_apply_step(apply_step, environment, slaves): apply_step['type'])) tasks_timeout = apply_step['tasks_timeout'] if 'tasks_timeout' in \ apply_step.keys() else 60 * 30 - command = [ + command = ( 'RUN_TASKS', nodes_ids, apply_step['tasks'], tasks_timeout - ] + ) else: assert_true(len(apply_step['command'] or '') > 0, "Step #{0} in apply patch scenario perform '{1}', but " diff --git a/fuelweb_test/models/fuel_web_client.py b/fuelweb_test/models/fuel_web_client.py index 1f2593555..39d44dd65 100644 --- a/fuelweb_test/models/fuel_web_client.py +++ b/fuelweb_test/models/fuel_web_client.py @@ -472,7 +472,7 @@ class FuelWebClient(object): attributes = self.client.get_cluster_attributes(cluster_id) for option in settings: - section = False + section = '' if option in ('sahara', 'murano', 'ceilometer', 'mongo', 'ironic'): section = 'additional_components' diff --git a/fuelweb_test/settings.py b/fuelweb_test/settings.py index c068d9db2..6e1f96ad7 100644 --- a/fuelweb_test/settings.py +++ b/fuelweb_test/settings.py @@ -148,7 +148,7 @@ if MULTIPLE_NETWORKS: ADMIN_FORWARD = os.environ.get('ADMIN_FORWARD', 'nat') PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', 'nat') else: - NODEGROUPS = {} + NODEGROUPS = () FORWARD_DEFAULT = os.environ.get('FORWARD_DEFAULT', None) ADMIN_FORWARD = os.environ.get('ADMIN_FORWARD', FORWARD_DEFAULT or 'nat') PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', FORWARD_DEFAULT or 'nat') diff --git a/fuelweb_test/testrail/generate_statistics.py b/fuelweb_test/testrail/generate_statistics.py index 15ba807ac..f924d983f 100644 --- a/fuelweb_test/testrail/generate_statistics.py +++ b/fuelweb_test/testrail/generate_statistics.py @@ -408,7 +408,7 @@ class StatisticsGenerator(object): return self.update_desription(header + bugs_table) -def save_stats_to_file(stats, file_name, html=False): +def save_stats_to_file(stats, file_name, html=''): def warn_file_exists(file_path): if os.path.exists(file_path): logger.warning('File {0} exists and will be ' diff --git a/fuelweb_test/tests/test_ceph.py b/fuelweb_test/tests/test_ceph.py index ab3af6d87..2415d5dc3 100644 --- a/fuelweb_test/tests/test_ceph.py +++ b/fuelweb_test/tests/test_ceph.py @@ -11,7 +11,7 @@ # 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 unicode_literals import time from pkg_resources import parse_version @@ -113,7 +113,8 @@ class CephCompact(TestBasic): self.fuel_web.get_public_vip(cluster_id), 'ceph1', 'ceph1', 'ceph1') - image_data = BytesIO(bytearray(self.__class__.__name__)) + image_data = BytesIO( + self.__class__.__name__.encode(encoding='ascii', errors='ignore')) image = os_conn.create_image(disk_format='raw', container_format='bare', name='test_ceph_cinder_cow', diff --git a/run_system_test.py b/run_system_test.py index 1f4549bb9..2bb1d2950 100755 --- a/run_system_test.py +++ b/run_system_test.py @@ -115,7 +115,7 @@ def cli(): def run(**kwargs): config_name = kwargs.get('config_name', None) - groups = kwargs.get('run_groups', None) + groups = kwargs.get('run_groups', []) old_groups = kwargs.get('groups', None) explain = kwargs.get('explain', None)