From 73fb88e9317f5f2e5270aca4976ffecd06621b0c Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 21 Mar 2013 12:21:55 -0500 Subject: [PATCH] Make entry point strings readable PEP8 E126 wants continued strings to line up vertically, totally destroying the readability and visual indication of the beginning of a string in a list * Ignore PEP8 E126 in order to indent the entry point strings in a readable manner. * Sort the enrty point command strings by object then verb. * Bring other ignores from run_tests.sh to tox.ini Change-Id: I2593de7d6c058322101bc68636317cdba29fe664 --- run_tests.sh | 2 +- setup.py | 236 ++++++++++++++++++++++++++++----------------------- tox.ini | 2 +- 3 files changed, 130 insertions(+), 110 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 8a4ae624c4..4992dee867 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -118,7 +118,7 @@ function run_pep8 { # other than what the PEP8 tool claims. It is deprecated in Python 3, so, # perhaps the mistake was thinking that the deprecation applied to Python 2 # as well. - pep8_opts="--ignore=E202,W602 --repeat" + pep8_opts="--ignore=E126,E202,W602 --repeat" ${wrapper} pep8 ${pep8_opts} ${srcfiles} } diff --git a/setup.py b/setup.py index eb193b4c24..336c7898f7 100644 --- a/setup.py +++ b/setup.py @@ -57,162 +57,182 @@ setuptools.setup( 'openstack.cli': [ ], 'openstack.identity.v2_0': [ - 'create_endpoint=' + - 'openstackclient.identity.v2_0.endpoint:CreateEndpoint', - 'delete_endpoint=' + - 'openstackclient.identity.v2_0.endpoint:DeleteEndpoint', - 'list_endpoint=' + - 'openstackclient.identity.v2_0.endpoint:ListEndpoint', - 'show_endpoint=' + - 'openstackclient.identity.v2_0.endpoint:ShowEndpoint', - 'add_role=' + - 'openstackclient.identity.v2_0.role:AddRole', - 'create_role=' + - 'openstackclient.identity.v2_0.role:CreateRole', - 'delete_role=' + - 'openstackclient.identity.v2_0.role:DeleteRole', + 'create_endpoint=' + 'openstackclient.identity.v2_0.endpoint:CreateEndpoint', + 'delete_endpoint=' + 'openstackclient.identity.v2_0.endpoint:DeleteEndpoint', + 'list_endpoint=' + 'openstackclient.identity.v2_0.endpoint:ListEndpoint', + 'show_endpoint=' + 'openstackclient.identity.v2_0.endpoint:ShowEndpoint', + + 'add_role=' + 'openstackclient.identity.v2_0.role:AddRole', + 'create_role=' + 'openstackclient.identity.v2_0.role:CreateRole', + 'delete_role=' + 'openstackclient.identity.v2_0.role:DeleteRole', 'list_role=openstackclient.identity.v2_0.role:ListRole', - 'remove_role=' + - 'openstackclient.identity.v2_0.role:RemoveRole', + 'remove_role=' + 'openstackclient.identity.v2_0.role:RemoveRole', 'show_role=openstackclient.identity.v2_0.role:ShowRole', - 'create_service=' + - 'openstackclient.identity.v2_0.service:CreateService', - 'delete_service=' + - 'openstackclient.identity.v2_0.service:DeleteService', + + 'create_service=' + 'openstackclient.identity.v2_0.service:CreateService', + 'delete_service=' + 'openstackclient.identity.v2_0.service:DeleteService', 'list_service=openstackclient.identity.v2_0.service:ListService', 'show_service=openstackclient.identity.v2_0.service:ShowService', - 'create_tenant=' + - 'openstackclient.identity.v2_0.tenant:CreateTenant', - 'delete_tenant=' + - 'openstackclient.identity.v2_0.tenant:DeleteTenant', + + 'create_tenant=' + 'openstackclient.identity.v2_0.tenant:CreateTenant', + 'delete_tenant=' + 'openstackclient.identity.v2_0.tenant:DeleteTenant', 'list_tenant=openstackclient.identity.v2_0.tenant:ListTenant', 'set_tenant=openstackclient.identity.v2_0.tenant:SetTenant', 'show_tenant=openstackclient.identity.v2_0.tenant:ShowTenant', + 'list_user-role=openstackclient.identity.v2_0.role:ListUserRole', - 'create_user=' + - 'openstackclient.identity.v2_0.user:CreateUser', - 'delete_user=' + - 'openstackclient.identity.v2_0.user:DeleteUser', + + 'create_user=' + 'openstackclient.identity.v2_0.user:CreateUser', + 'delete_user=' + 'openstackclient.identity.v2_0.user:DeleteUser', 'list_user=openstackclient.identity.v2_0.user:ListUser', 'set_user=openstackclient.identity.v2_0.user:SetUser', 'show_user=openstackclient.identity.v2_0.user:ShowUser', ], 'openstack.identity.v3': [ - 'create_group=openstackclient.identity.v3.group:CreateGroup', - 'delete_group=openstackclient.identity.v3.group:DeleteGroup', - 'set_group=openstackclient.identity.v3.group:SetGroup', - 'show_group=openstackclient.identity.v3.group:ShowGroup', - 'list_group=openstackclient.identity.v3.group:ListGroup', - 'create_project=' + - 'openstackclient.identity.v3.project:CreateProject', - 'delete_project=' + - 'openstackclient.identity.v3.project:DeleteProject', - 'set_project=openstackclient.identity.v3.project:SetProject', - 'show_project=openstackclient.identity.v3.project:ShowProject', - 'list_project=openstackclient.identity.v3.project:ListProject', - 'create_user=' + - 'openstackclient.identity.v3.user:CreateUser', - 'delete_user=' + - 'openstackclient.identity.v3.user:DeleteUser', - 'list_user=openstackclient.identity.v3.user:ListUser', - 'set_user=openstackclient.identity.v3.user:SetUser', - 'show_user=openstackclient.identity.v3.user:ShowUser', - 'create_credential=' + - 'openstackclient.identity.v3.credential:CreateCredential', - 'delete_credential=' + - 'openstackclient.identity.v3.credential:DeleteCredential', - 'set_credential=' + - 'openstackclient.identity.v3.credential:SetCredential', - 'show_credential=' + - 'openstackclient.identity.v3.credential:ShowCredential', - 'list_credential=' + - 'openstackclient.identity.v3.credential:ListCredential', + 'create_credential=' + 'openstackclient.identity.v3.credential:CreateCredential', + 'delete_credential=' + 'openstackclient.identity.v3.credential:DeleteCredential', + 'list_credential=' + 'openstackclient.identity.v3.credential:ListCredential', + 'set_credential=' + 'openstackclient.identity.v3.credential:SetCredential', + 'show_credential=' + 'openstackclient.identity.v3.credential:ShowCredential', + 'create_domain=openstackclient.identity.v3.domain:CreateDomain', 'delete_domain=openstackclient.identity.v3.domain:DeleteDomain', + 'list_domain=openstackclient.identity.v3.domain:ListDomain', 'set_domain=openstackclient.identity.v3.domain:SetDomain', 'show_domain=openstackclient.identity.v3.domain:ShowDomain', - 'list_domain=openstackclient.identity.v3.domain:ListDomain', - 'create_role=' + - 'openstackclient.identity.v3.role:CreateRole', - 'delete_role=' + - 'openstackclient.identity.v3.role:DeleteRole', - 'list_role=openstackclient.identity.v3.role:ListRole', - 'show_role=openstackclient.identity.v3.role:ShowRole', - 'set_role=openstackclient.identity.v3.role:SetRole', - 'add_role=openstackclient.identity.v3.role:AddRole', - 'create_service=' + - 'openstackclient.identity.v3.service:CreateService', - 'delete_service=' + - 'openstackclient.identity.v3.service:DeleteService', - 'list_service=openstackclient.identity.v3.service:ListService', - 'show_service=openstackclient.identity.v3.service:ShowService', - 'set_service=openstackclient.identity.v3.service:SetService', - 'create_endpoint=' + - 'openstackclient.identity.v3.endpoint:CreateEndpoint', - 'delete_endpoint=' + - 'openstackclient.identity.v3.endpoint:DeleteEndpoint', + + 'create_endpoint=' + 'openstackclient.identity.v3.endpoint:CreateEndpoint', + 'delete_endpoint=' + 'openstackclient.identity.v3.endpoint:DeleteEndpoint', 'set_endpoint=openstackclient.identity.v3.endpoint:SetEndpoint', 'show_endpoint=openstackclient.identity.v3.endpoint:ShowEndpoint', 'list_endpoint=openstackclient.identity.v3.endpoint:ListEndpoint', + + 'create_group=openstackclient.identity.v3.group:CreateGroup', + 'delete_group=openstackclient.identity.v3.group:DeleteGroup', + 'list_group=openstackclient.identity.v3.group:ListGroup', + 'set_group=openstackclient.identity.v3.group:SetGroup', + 'show_group=openstackclient.identity.v3.group:ShowGroup', + + 'create_project=' + 'openstackclient.identity.v3.project:CreateProject', + 'delete_project=' + 'openstackclient.identity.v3.project:DeleteProject', + 'list_project=openstackclient.identity.v3.project:ListProject', + 'set_project=openstackclient.identity.v3.project:SetProject', + 'show_project=openstackclient.identity.v3.project:ShowProject', + + 'add_role=openstackclient.identity.v3.role:AddRole', + 'create_role=' + 'openstackclient.identity.v3.role:CreateRole', + 'delete_role=' + 'openstackclient.identity.v3.role:DeleteRole', + 'list_role=openstackclient.identity.v3.role:ListRole', + 'show_role=openstackclient.identity.v3.role:ShowRole', + 'set_role=openstackclient.identity.v3.role:SetRole', + + 'create_service=' + 'openstackclient.identity.v3.service:CreateService', + 'delete_service=' + 'openstackclient.identity.v3.service:DeleteService', + 'list_service=openstackclient.identity.v3.service:ListService', + 'show_service=openstackclient.identity.v3.service:ShowService', + 'set_service=openstackclient.identity.v3.service:SetService', + + 'create_user=' + 'openstackclient.identity.v3.user:CreateUser', + 'delete_user=' + 'openstackclient.identity.v3.user:DeleteUser', + 'list_user=openstackclient.identity.v3.user:ListUser', + 'set_user=openstackclient.identity.v3.user:SetUser', + 'show_user=openstackclient.identity.v3.user:ShowUser', ], 'openstack.image.v2': [ 'list_image=openstackclient.image.v2.image:ListImage', - 'show_image=openstackclient.image.v2.image:ShowImage', 'save_image=openstackclient.image.v2.image:SaveImage', + 'show_image=openstackclient.image.v2.image:ShowImage', ], 'openstack.compute.v2': [ 'create_agent=openstackclient.compute.v2.agent:CreateAgent', - 'create_flavor=openstackclient.compute.v2.flavor:CreateFlavor', - 'create_server=openstackclient.compute.v2.server:CreateServer', 'delete_agent=openstackclient.compute.v2.agent:DeleteAgent', - 'delete_flavor=openstackclient.compute.v2.flavor:DeleteFlavor', - 'delete_server=openstackclient.compute.v2.server:DeleteServer', 'list_agent=openstackclient.compute.v2.agent:ListAgent', + 'set_agent=openstackclient.compute.v2.agent:SetAgent', + + 'list_compute-service=' + 'openstackclient.compute.v2.service:ListService', + 'set_compute-service=' + 'openstackclient.compute.v2.service:SetService', + + 'create_flavor=openstackclient.compute.v2.flavor:CreateFlavor', + 'delete_flavor=openstackclient.compute.v2.flavor:DeleteFlavor', 'list_flavor=openstackclient.compute.v2.flavor:ListFlavor', + 'show_flavor=openstackclient.compute.v2.flavor:ShowFlavor', + 'list_host=openstackclient.compute.v2.host:ListHost', - 'list_hypervisor=' + - 'openstackclient.compute.v2.hypervisor:ListHypervisor', + 'show_host=openstackclient.compute.v2.host:ShowHost', + + 'list_hypervisor=' + 'openstackclient.compute.v2.hypervisor:ListHypervisor', + 'show_hypervisor=' + 'openstackclient.compute.v2.hypervisor:ShowHypervisor', + + 'create_server=openstackclient.compute.v2.server:CreateServer', + 'delete_server=openstackclient.compute.v2.server:DeleteServer', 'list_server=openstackclient.compute.v2.server:ListServer', - 'list_compute-service=' + - 'openstackclient.compute.v2.service:ListService', 'pause_server=openstackclient.compute.v2.server:PauseServer', 'reboot_server=openstackclient.compute.v2.server:RebootServer', 'rebuild_server=openstackclient.compute.v2.server:RebuildServer', 'resume_server=openstackclient.compute.v2.server:ResumeServer', - 'set_agent=openstackclient.compute.v2.agent:SetAgent', - 'set_compute-service=' + - 'openstackclient.compute.v2.service:SetService', - 'show_flavor=openstackclient.compute.v2.flavor:ShowFlavor', - 'show_host=openstackclient.compute.v2.host:ShowHost', - 'show_hypervisor=' + - 'openstackclient.compute.v2.hypervisor:ShowHypervisor', 'show_server=openstackclient.compute.v2.server:ShowServer', 'suspend_server=openstackclient.compute.v2.server:SuspendServer', 'unpause_server=openstackclient.compute.v2.server:UnpauseServer', ], 'openstack.volume.v1': [ - 'create_volume-type=' + - 'openstackclient.volume.v1.type:CreateVolumeType', - 'delete_volume-type=' + - 'openstackclient.volume.v1.type:DeleteVolumeType', - 'list_volume-type=openstackclient.volume.v1.type:ListVolumeType', - 'set_volume-type=openstackclient.volume.v1.type:SetVolumeType', - 'unset_volume-type=openstackclient.volume.v1.type:UnsetVolumeType', - 'show_quota=openstackclient.volume.v1.quota:ShowQuota', 'list_quota=openstackclient.volume.v1.quota:ListQuota', 'set_quota=openstackclient.volume.v1.quota:SetQuota', + 'show_quota=openstackclient.volume.v1.quota:ShowQuota', + + 'create_snapshot=' + 'openstackclient.volume.v1.snapshot:CreateSnapshot', + 'delete_snapshot=' + 'openstackclient.volume.v1.snapshot:DeleteSnapshot', + 'list_snapshot=openstackclient.volume.v1.snapshot:ListSnapshot', + 'set_snapshot=openstackclient.volume.v1.snapshot:SetSnapshot', + 'show_snapshot=openstackclient.volume.v1.snapshot:ShowSnapshot', + 'create_volume=openstackclient.volume.v1.volume:CreateVolume', 'delete_volume=openstackclient.volume.v1.volume:DeleteVolume', 'list_volume=openstackclient.volume.v1.volume:ListVolume', 'set_volume=openstackclient.volume.v1.volume:SetVolume', 'show_volume=openstackclient.volume.v1.volume:ShowVolume', - 'create_snapshot=' + - 'openstackclient.volume.v1.snapshot:CreateSnapshot', - 'delete_snapshot=' + - 'openstackclient.volume.v1.snapshot:DeleteSnapshot', - 'list_snapshot=openstackclient.volume.v1.snapshot:ListSnapshot', - 'set_snapshot=openstackclient.volume.v1.snapshot:SetSnapshot', - 'show_snapshot=openstackclient.volume.v1.snapshot:ShowSnapshot', + + 'create_volume-type=' + 'openstackclient.volume.v1.type:CreateVolumeType', + 'delete_volume-type=' + 'openstackclient.volume.v1.type:DeleteVolumeType', + 'list_volume-type=openstackclient.volume.v1.type:ListVolumeType', + 'set_volume-type=openstackclient.volume.v1.type:SetVolumeType', + 'unset_volume-type=openstackclient.volume.v1.type:UnsetVolumeType', ] } ) diff --git a/tox.ini b/tox.ini index fb1b2ba699..9b5a843bf1 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ commands = python setup.py testr --testr-args='{posargs}' [testenv:pep8] deps = pep8==1.3.3 -commands = pep8 --repeat --show-source openstackclient setup.py +commands = pep8 --ignore=E126,E202,W602 --repeat --show-source openstackclient setup.py [testenv:venv] commands = {posargs}