Pylint: fix trivial issues 10

Change-Id: I5cbf0cf588f8cbeefefcd1fac3ba714fb6426a40
fix: redefined variable type
Related-bug: #1556791
This commit is contained in:
Alexey Stepanov 2016-03-15 17:40:41 +03:00
parent ca50c2f7a5
commit fe0dc7cacb
7 changed files with 17 additions and 15 deletions

View File

@ -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,

View File

@ -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 "

View File

@ -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'

View File

@ -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')

View File

@ -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 '

View File

@ -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',

View File

@ -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)