From a5202573a27587233886d62db113cc3cab0a74fa Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 16 Mar 2017 14:52:50 +0100 Subject: Reindent code --- roles/lib_openshift/library/oc_project.py | 21 ++++++++++++--------- roles/lib_openshift/src/class/oc_project.py | 21 ++++++++++++--------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/roles/lib_openshift/library/oc_project.py b/roles/lib_openshift/library/oc_project.py index 0d0094c45..6cf993d64 100644 --- a/roles/lib_openshift/library/oc_project.py +++ b/roles/lib_openshift/library/oc_project.py @@ -1551,15 +1551,18 @@ class OCProject(OpenShiftCLI): if params['node_selector'] is not None: _ns = ','.join(params['node_selector']) - pconfig = ProjectConfig(params['name'], - 'None', - params['kubeconfig'], - {'admin': {'value': params['admin'], 'include': True}, - 'admin_role': {'value': params['admin_role'], 'include': True}, - 'description': {'value': params['description'], 'include': True}, - 'display_name': {'value': params['display_name'], 'include': True}, - 'node_selector': {'value': _ns, 'include': True}, - }) + pconfig = ProjectConfig( + params['name'], + 'None', + params['kubeconfig'], + { + 'admin': {'value': params['admin'], 'include': True}, + 'admin_role': {'value': params['admin_role'], 'include': True}, + 'description': {'value': params['description'], 'include': True}, + 'display_name': {'value': params['display_name'], 'include': True}, + 'node_selector': {'value': _ns, 'include': True}, + }, + ) oadm_project = OCProject(pconfig, verbose=params['debug']) diff --git a/roles/lib_openshift/src/class/oc_project.py b/roles/lib_openshift/src/class/oc_project.py index 5f02957b7..4dd231198 100644 --- a/roles/lib_openshift/src/class/oc_project.py +++ b/roles/lib_openshift/src/class/oc_project.py @@ -101,15 +101,18 @@ class OCProject(OpenShiftCLI): if params['node_selector'] is not None: _ns = ','.join(params['node_selector']) - pconfig = ProjectConfig(params['name'], - 'None', - params['kubeconfig'], - {'admin': {'value': params['admin'], 'include': True}, - 'admin_role': {'value': params['admin_role'], 'include': True}, - 'description': {'value': params['description'], 'include': True}, - 'display_name': {'value': params['display_name'], 'include': True}, - 'node_selector': {'value': _ns, 'include': True}, - }) + pconfig = ProjectConfig( + params['name'], + 'None', + params['kubeconfig'], + { + 'admin': {'value': params['admin'], 'include': True}, + 'admin_role': {'value': params['admin_role'], 'include': True}, + 'description': {'value': params['description'], 'include': True}, + 'display_name': {'value': params['display_name'], 'include': True}, + 'node_selector': {'value': _ns, 'include': True}, + }, + ) oadm_project = OCProject(pconfig, verbose=params['debug']) -- cgit v1.2.3 From e8c7a48c443f2327470fac0f4fa5ef1f6dced29f Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 16 Mar 2017 14:53:27 +0100 Subject: Rename _ns -> node_selector There doesn't seem to be a good reason for the underscore prefix. --- roles/lib_openshift/library/oc_project.py | 6 +++--- roles/lib_openshift/src/class/oc_project.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/lib_openshift/library/oc_project.py b/roles/lib_openshift/library/oc_project.py index 6cf993d64..7700a83a3 100644 --- a/roles/lib_openshift/library/oc_project.py +++ b/roles/lib_openshift/library/oc_project.py @@ -1547,9 +1547,9 @@ class OCProject(OpenShiftCLI): def run_ansible(params, check_mode): '''run the idempotent ansible code''' - _ns = None + node_selector = None if params['node_selector'] is not None: - _ns = ','.join(params['node_selector']) + node_selector = ','.join(params['node_selector']) pconfig = ProjectConfig( params['name'], @@ -1560,7 +1560,7 @@ class OCProject(OpenShiftCLI): 'admin_role': {'value': params['admin_role'], 'include': True}, 'description': {'value': params['description'], 'include': True}, 'display_name': {'value': params['display_name'], 'include': True}, - 'node_selector': {'value': _ns, 'include': True}, + 'node_selector': {'value': node_selector, 'include': True}, }, ) diff --git a/roles/lib_openshift/src/class/oc_project.py b/roles/lib_openshift/src/class/oc_project.py index 4dd231198..9ad8111a8 100644 --- a/roles/lib_openshift/src/class/oc_project.py +++ b/roles/lib_openshift/src/class/oc_project.py @@ -97,9 +97,9 @@ class OCProject(OpenShiftCLI): def run_ansible(params, check_mode): '''run the idempotent ansible code''' - _ns = None + node_selector = None if params['node_selector'] is not None: - _ns = ','.join(params['node_selector']) + node_selector = ','.join(params['node_selector']) pconfig = ProjectConfig( params['name'], @@ -110,7 +110,7 @@ class OCProject(OpenShiftCLI): 'admin_role': {'value': params['admin_role'], 'include': True}, 'description': {'value': params['description'], 'include': True}, 'display_name': {'value': params['display_name'], 'include': True}, - 'node_selector': {'value': _ns, 'include': True}, + 'node_selector': {'value': node_selector, 'include': True}, }, ) -- cgit v1.2.3 From ae22d7d5ed03d254b0ebf17a45a693668f10f8b5 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 16 Mar 2017 14:54:46 +0100 Subject: Fix copy-pasta docstrings --- roles/lib_openshift/src/test/unit/test_oc_project.py | 2 +- roles/lib_openshift/src/test/unit/test_oc_route.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/lib_openshift/src/test/unit/test_oc_project.py b/roles/lib_openshift/src/test/unit/test_oc_project.py index 8e1a76323..fa454d035 100755 --- a/roles/lib_openshift/src/test/unit/test_oc_project.py +++ b/roles/lib_openshift/src/test/unit/test_oc_project.py @@ -21,7 +21,7 @@ from oc_project import OCProject # noqa: E402 class OCProjectTest(unittest.TestCase): ''' - Test class for OCSecret + Test class for OCProject ''' # run_ansible input parameters diff --git a/roles/lib_openshift/src/test/unit/test_oc_route.py b/roles/lib_openshift/src/test/unit/test_oc_route.py index 09c52a461..afdb5e4dc 100755 --- a/roles/lib_openshift/src/test/unit/test_oc_route.py +++ b/roles/lib_openshift/src/test/unit/test_oc_route.py @@ -21,7 +21,7 @@ from oc_route import OCRoute, locate_oc_binary # noqa: E402 class OCRouteTest(unittest.TestCase): ''' - Test class for OCServiceAccount + Test class for OCRoute ''' @mock.patch('oc_route.locate_oc_binary') -- cgit v1.2.3