Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use flake8 and hacking.
Fixes bug 1172444

Change-Id: I46b733bd16fa49c58c642348988233064d2b673b
  • Loading branch information
emonty committed May 11, 2013
1 parent 381049b commit c23f620
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 462 deletions.
28 changes: 14 additions & 14 deletions cinder/backup/services/__init__.py
@@ -1,14 +1,14 @@
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# 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.
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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.
12 changes: 6 additions & 6 deletions cinder/tests/test_storwize_svc.py
Expand Up @@ -565,7 +565,7 @@ def _cmd_rmvdisk(self, **kwargs):
return self._errors['CMMVC5701E']
vol_name = kwargs['obj'].strip('\'\'')

if not vol_name in self._volumes_list:
if vol_name not in self._volumes_list:
return self._errors['CMMVC5753E']

if not force:
Expand Down Expand Up @@ -870,10 +870,10 @@ def _cmd_mkvdiskhostmap(self, **kwargs):
return self._errors['CMMVC5707E']
mapping_info['vol'] = kwargs['obj'].strip('\'\'')

if not mapping_info['vol'] in self._volumes_list:
if mapping_info['vol'] not in self._volumes_list:
return self._errors['CMMVC5753E']

if not mapping_info['host'] in self._hosts_list:
if mapping_info['host'] not in self._hosts_list:
return self._errors['CMMVC5754E']

if mapping_info['vol'] in self._mappings_list:
Expand All @@ -898,7 +898,7 @@ def _cmd_rmvdiskhostmap(self, **kwargs):
return self._errors['CMMVC5701E']
vol = kwargs['obj'].strip('\'\'')

if not vol in self._mappings_list:
if vol not in self._mappings_list:
return self._errors['CMMVC5753E']

if self._mappings_list[vol]['host'] != host:
Expand Down Expand Up @@ -939,13 +939,13 @@ def _cmd_mkfcmap(self, **kwargs):
if 'source' not in kwargs:
return self._errors['CMMVC5707E']
source = kwargs['source'].strip('\'\'')
if not source in self._volumes_list:
if source not in self._volumes_list:
return self._errors['CMMVC5754E']

if 'target' not in kwargs:
return self._errors['CMMVC5707E']
target = kwargs['target'].strip('\'\'')
if not target in self._volumes_list:
if target not in self._volumes_list:
return self._errors['CMMVC5754E']

if source == target:
Expand Down
2 changes: 1 addition & 1 deletion cinder/volume/drivers/storwize_svc.py
Expand Up @@ -1420,7 +1420,7 @@ def _check_vdisk_opts(self, opts):
'also be set (not equal to -1)'))

# Check that the requested protocol is enabled
if not opts['protocol'] in self._enabled_protocols:
if opts['protocol'] not in self._enabled_protocols:
raise exception.InvalidInput(
reason=_('Illegal value %(prot)s specified for '
'storwize_svc_connection_protocol: '
Expand Down
24 changes: 0 additions & 24 deletions tools/flakes.py

This file was deleted.

0 comments on commit c23f620

Please sign in to comment.