Pylint: fix trivial issues 10
Change-Id: I5cbf0cf588f8cbeefefcd1fac3ba714fb6426a40 fix: redefined variable type Related-bug: #1556791
This commit is contained in:
parent
ca50c2f7a5
commit
fe0dc7cacb
|
@ -131,7 +131,7 @@ class OpenStackActions(common.Common):
|
||||||
image_id = self._get_cirros_image().id
|
image_id = self._get_cirros_image().id
|
||||||
security_group[self.keystone.tenant_id] =\
|
security_group[self.keystone.tenant_id] =\
|
||||||
self.create_sec_group_for_ssh()
|
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:
|
if neutron:
|
||||||
net_label = label if label else 'net04'
|
net_label = label if label else 'net04'
|
||||||
|
@ -139,9 +139,9 @@ class OpenStackActions(common.Common):
|
||||||
if net.label == net_label]
|
if net.label == net_label]
|
||||||
|
|
||||||
kwargs.update({'nics': [{'net-id': network[0]}],
|
kwargs.update({'nics': [{'net-id': network[0]}],
|
||||||
'security_groups': security_group})
|
'security_groups': security_groups})
|
||||||
else:
|
else:
|
||||||
kwargs.update({'security_groups': security_group})
|
kwargs.update({'security_groups': security_groups})
|
||||||
|
|
||||||
srv = self.nova.servers.create(name=name,
|
srv = self.nova.servers.create(name=name,
|
||||||
image=image_id,
|
image=image_id,
|
||||||
|
|
|
@ -431,7 +431,7 @@ def verify_fix_apply_step(apply_step):
|
||||||
def validate_fix_apply_step(apply_step, environment, slaves):
|
def validate_fix_apply_step(apply_step, environment, slaves):
|
||||||
verify_fix_apply_step(apply_step)
|
verify_fix_apply_step(apply_step)
|
||||||
slaves = [] if not slaves else slaves
|
slaves = [] if not slaves else slaves
|
||||||
command = ''
|
command = '',
|
||||||
remotes_ips = set()
|
remotes_ips = set()
|
||||||
devops_action = ''
|
devops_action = ''
|
||||||
devops_nodes = set()
|
devops_nodes = set()
|
||||||
|
@ -472,9 +472,10 @@ def validate_fix_apply_step(apply_step, environment, slaves):
|
||||||
"service isn't specified".format(apply_step['id'],
|
"service isn't specified".format(apply_step['id'],
|
||||||
apply_step['type']))
|
apply_step['type']))
|
||||||
action = apply_step['type'].split('service_')[1]
|
action = apply_step['type'].split('service_')[1]
|
||||||
command = ("find /etc/init.d/ -regex '/etc/init.d/{service}' -printf "
|
command = (
|
||||||
"'%f\n' -quit | xargs -i service {{}} {action}").format(
|
"find /etc/init.d/ -regex '/etc/init.d/{service}' -printf "
|
||||||
service=apply_step['service'], action=action)
|
"'%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'):
|
elif apply_step['type'] in ('server_down', 'server_up', 'server_reboot'):
|
||||||
assert_true('master' not in apply_step['target'],
|
assert_true('master' not in apply_step['target'],
|
||||||
'Action type "{0}" doesn\'t accept "master" node as '
|
'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']))
|
apply_step['type']))
|
||||||
tasks_timeout = apply_step['tasks_timeout'] if 'tasks_timeout' in \
|
tasks_timeout = apply_step['tasks_timeout'] if 'tasks_timeout' in \
|
||||||
apply_step.keys() else 60 * 30
|
apply_step.keys() else 60 * 30
|
||||||
command = [
|
command = (
|
||||||
'RUN_TASKS',
|
'RUN_TASKS',
|
||||||
nodes_ids,
|
nodes_ids,
|
||||||
apply_step['tasks'],
|
apply_step['tasks'],
|
||||||
tasks_timeout
|
tasks_timeout
|
||||||
]
|
)
|
||||||
else:
|
else:
|
||||||
assert_true(len(apply_step['command'] or '') > 0,
|
assert_true(len(apply_step['command'] or '') > 0,
|
||||||
"Step #{0} in apply patch scenario perform '{1}', but "
|
"Step #{0} in apply patch scenario perform '{1}', but "
|
||||||
|
|
|
@ -472,7 +472,7 @@ class FuelWebClient(object):
|
||||||
attributes = self.client.get_cluster_attributes(cluster_id)
|
attributes = self.client.get_cluster_attributes(cluster_id)
|
||||||
|
|
||||||
for option in settings:
|
for option in settings:
|
||||||
section = False
|
section = ''
|
||||||
if option in ('sahara', 'murano', 'ceilometer', 'mongo',
|
if option in ('sahara', 'murano', 'ceilometer', 'mongo',
|
||||||
'ironic'):
|
'ironic'):
|
||||||
section = 'additional_components'
|
section = 'additional_components'
|
||||||
|
|
|
@ -148,7 +148,7 @@ if MULTIPLE_NETWORKS:
|
||||||
ADMIN_FORWARD = os.environ.get('ADMIN_FORWARD', 'nat')
|
ADMIN_FORWARD = os.environ.get('ADMIN_FORWARD', 'nat')
|
||||||
PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', 'nat')
|
PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', 'nat')
|
||||||
else:
|
else:
|
||||||
NODEGROUPS = {}
|
NODEGROUPS = ()
|
||||||
FORWARD_DEFAULT = os.environ.get('FORWARD_DEFAULT', None)
|
FORWARD_DEFAULT = os.environ.get('FORWARD_DEFAULT', None)
|
||||||
ADMIN_FORWARD = os.environ.get('ADMIN_FORWARD', FORWARD_DEFAULT or 'nat')
|
ADMIN_FORWARD = os.environ.get('ADMIN_FORWARD', FORWARD_DEFAULT or 'nat')
|
||||||
PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', FORWARD_DEFAULT or 'nat')
|
PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', FORWARD_DEFAULT or 'nat')
|
||||||
|
|
|
@ -408,7 +408,7 @@ class StatisticsGenerator(object):
|
||||||
return self.update_desription(header + bugs_table)
|
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):
|
def warn_file_exists(file_path):
|
||||||
if os.path.exists(file_path):
|
if os.path.exists(file_path):
|
||||||
logger.warning('File {0} exists and will be '
|
logger.warning('File {0} exists and will be '
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
from __future__ import unicode_literals
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from pkg_resources import parse_version
|
from pkg_resources import parse_version
|
||||||
|
@ -113,7 +113,8 @@ class CephCompact(TestBasic):
|
||||||
self.fuel_web.get_public_vip(cluster_id), 'ceph1', 'ceph1',
|
self.fuel_web.get_public_vip(cluster_id), 'ceph1', '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',
|
image = os_conn.create_image(disk_format='raw',
|
||||||
container_format='bare',
|
container_format='bare',
|
||||||
name='test_ceph_cinder_cow',
|
name='test_ceph_cinder_cow',
|
||||||
|
|
|
@ -115,7 +115,7 @@ def cli():
|
||||||
|
|
||||||
def run(**kwargs):
|
def run(**kwargs):
|
||||||
config_name = kwargs.get('config_name', None)
|
config_name = kwargs.get('config_name', None)
|
||||||
groups = kwargs.get('run_groups', None)
|
groups = kwargs.get('run_groups', [])
|
||||||
old_groups = kwargs.get('groups', None)
|
old_groups = kwargs.get('groups', None)
|
||||||
explain = kwargs.get('explain', None)
|
explain = kwargs.get('explain', None)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue