Resolve pep8 violations caught by pep8 v1.7.0

This patch resolves new pep8 violations caught by pep8 v1.7.0.

Change-Id: Ib1f1681d2872830f9c240e43d472f42b79a432a0
This commit is contained in:
Jesse Pretorius 2016-01-13 10:40:49 +00:00
parent d071e0f4ff
commit bd69198185
9 changed files with 41 additions and 27 deletions

View File

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
@ -162,7 +164,5 @@ def main():
resp.update(module.params) resp.update(module.params)
module.fail_json(msg='Failed Process', **resp) module.fail_json(msg='Failed Process', **resp)
# import module snippets
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -13,6 +13,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import glanceclient.client as glclient
import keystoneclient.v3.client as ksclient
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: glance module: glance
@ -86,10 +94,6 @@ EXAMPLES = """
""" """
import glanceclient.client as glclient
import keystoneclient.v3.client as ksclient
COMMAND_MAP = {'image-list': 'list_images', COMMAND_MAP = {'image-list': 'list_images',
'image-create': 'create_image'} 'image-create': 'create_image'}
@ -228,6 +232,5 @@ def main():
mg = ManageGlance(module) mg = ManageGlance(module)
mg.route() mg.route()
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -881,8 +881,8 @@ class ManageKeystone(object):
# NOTE(sigmavirus24): Try to get the project_name, but # NOTE(sigmavirus24): Try to get the project_name, but
# don't error out on it. This will change when the playbooks are # don't error out on it. This will change when the playbooks are
# updated to use project_name instead of tenant_name # updated to use project_name instead of tenant_name
project_name = (variables_dict.pop('project_name', None) project_name = (variables_dict.pop('project_name', None) or
or variables_dict.pop('tenant_name')) variables_dict.pop('tenant_name'))
role_name = variables_dict.pop('role_name') role_name = variables_dict.pop('role_name')
user, project, role, group = self._get_role_data( user, project, role, group = self._get_role_data(

View File

@ -29,6 +29,8 @@ try:
except ImportError: except ImportError:
ENCRYPT_IMPORT = False ENCRYPT_IMPORT = False
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
@ -592,7 +594,5 @@ def main():
ms = Memcached(module=module) ms = Memcached(module=module)
ms.router() ms.router()
# import module snippets
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -15,6 +15,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import hashlib
import platform
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: name2int module: name2int
@ -37,9 +44,6 @@ EXAMPLES = """
name: "Some-hostname.com" name: "Some-hostname.com"
""" """
import hashlib
import platform
class HashHostname(object): class HashHostname(object):
def __init__(self, module): def __init__(self, module):
@ -71,7 +75,5 @@ def main():
resp = {'stderr': exp} resp = {'stderr': exp}
module.fail_json(msg='Failed Process', **resp) module.fail_json(msg='Failed Process', **resp)
# import module snippets
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -13,6 +13,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import keystoneclient.v3.client as ksclient
from neutronclient.neutron import client as nclient
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: neutron module: neutron
@ -114,10 +122,6 @@ EXAMPLES = """
""" """
import keystoneclient.v3.client as ksclient
from neutronclient.neutron import client as nclient
COMMAND_MAP = { COMMAND_MAP = {
'create_network': { 'create_network': {
'variables': [ 'variables': [
@ -414,6 +418,5 @@ def main():
mn = ManageNeutron(module) mn = ManageNeutron(module)
mn.command_router() mn.command_router()
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -15,6 +15,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: provider_networks module: provider_networks
@ -274,7 +279,5 @@ def main():
resp = {'stderr': exp} resp = {'stderr': exp}
module.fail_json(msg='Failed Process', **resp) module.fail_json(msg='Failed Process', **resp)
# import module snippets
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -15,6 +15,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# import module snippets
from ansible.module_utils.basic import *
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: keystone_sp module: keystone_sp
@ -111,7 +116,5 @@ def main():
resp = {'stderr': exp} resp = {'stderr': exp}
module.fail_json(msg='Failed Process', **resp) module.fail_json(msg='Failed Process', **resp)
# import module snippets
from ansible.module_utils.basic import *
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -180,8 +180,8 @@ def get_groups_for_container(inventory, container_name):
# Beware, this dictionary comprehension requires Python 2.7, but we should # Beware, this dictionary comprehension requires Python 2.7, but we should
# have this on openstack-ansible hosts already. # have this on openstack-ansible hosts already.
groups = {k for (k, v) in inventory.items() if groups = {k for (k, v) in inventory.items() if
('hosts' in v ('hosts' in v and
and container_name in v['hosts'])} container_name in v['hosts'])}
return groups return groups