Browse Source

Merge pull request #3626 from mtnbikenc/module_rename

Merged by openshift-bot
OpenShift Bot 8 years ago
parent
commit
ca7a72e553

+ 2 - 2
playbooks/byo/openshift-cluster/upgrades/docker/docker_upgrade.yml

@@ -28,7 +28,7 @@
 
   tasks:
   - name: Mark node unschedulable
-    oadm_manage_node:
+    oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"
       schedulable: False
     delegate_to: "{{ groups.oo_first_master.0 }}"
@@ -51,7 +51,7 @@
     when: l_docker_upgrade is defined and l_docker_upgrade | bool
 
   - name: Set node schedulability
-    oadm_manage_node:
+    oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"
       schedulable: True
     delegate_to: "{{ groups.oo_first_master.0 }}"

+ 2 - 2
playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml

@@ -262,7 +262,7 @@
   # or docker actually needs an upgrade before proceeding. Perhaps best to save this until
   # we merge upgrade functionality into the base roles and a normal config.yml playbook run.
   - name: Mark node unschedulable
-    oadm_manage_node:
+    oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"
       schedulable: False
     delegate_to: "{{ groups.oo_first_master.0 }}"
@@ -284,7 +284,7 @@
 
   post_tasks:
   - name: Set node schedulability
-    oadm_manage_node:
+    oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"
       schedulable: True
     delegate_to: "{{ groups.oo_first_master.0 }}"

+ 2 - 2
playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml

@@ -15,7 +15,7 @@
   # or docker actually needs an upgrade before proceeding. Perhaps best to save this until
   # we merge upgrade functionality into the base roles and a normal config.yml playbook run.
   - name: Mark node unschedulable
-    oadm_manage_node:
+    oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"
       schedulable: False
     delegate_to: "{{ groups.oo_first_master.0 }}"
@@ -37,7 +37,7 @@
 
   post_tasks:
   - name: Set node schedulability
-    oadm_manage_node:
+    oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"
       schedulable: True
     delegate_to: "{{ groups.oo_first_master.0 }}"

+ 7 - 7
roles/lib_openshift/library/oadm_manage_node.py

@@ -54,7 +54,7 @@ from ansible.module_utils.basic import AnsibleModule
 
 DOCUMENTATION = '''
 ---
-module: oadm_manage_node
+module: oc_adm_manage_node
 short_description: Module to manage openshift nodes
 description:
   - Manage openshift nodes programmatically.
@@ -126,13 +126,13 @@ extends_documentation_fragment: []
 
 EXAMPLES = '''
 - name: oadm manage-node --schedulable=true --selector=ops_node=new
-  oadm_manage_node:
+  oc_adm_manage_node:
     selector: ops_node=new
     schedulable: True
   register: schedout
 
 - name: oadm manage-node my-k8s-node-5 --evacuate
-  oadm_manage_node:
+  oc_adm_manage_node:
     node:  my-k8s-node-5
     evacuate: True
     force: True
@@ -1369,7 +1369,7 @@ class OpenShiftCLIConfig(object):
 
 # -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-
 
-# -*- -*- -*- Begin included fragment: class/oadm_manage_node.py -*- -*- -*-
+# -*- -*- -*- Begin included fragment: class/oc_adm_manage_node.py -*- -*- -*-
 
 
 class ManageNodeException(Exception):
@@ -1578,9 +1578,9 @@ class ManageNode(OpenShiftCLI):
 
         return {'changed': changed, 'results': results, 'state': "present"}
 
-# -*- -*- -*- End included fragment: class/oadm_manage_node.py -*- -*- -*-
+# -*- -*- -*- End included fragment: class/oc_adm_manage_node.py -*- -*- -*-
 
-# -*- -*- -*- Begin included fragment: ansible/oadm_manage_node.py -*- -*- -*-
+# -*- -*- -*- Begin included fragment: ansible/oc_adm_manage_node.py -*- -*- -*-
 
 
 def main():
@@ -1618,4 +1618,4 @@ def main():
 if __name__ == "__main__":
     main()
 
-# -*- -*- -*- End included fragment: ansible/oadm_manage_node.py -*- -*- -*-
+# -*- -*- -*- End included fragment: ansible/oc_adm_manage_node.py -*- -*- -*-

roles/lib_openshift/src/ansible/oadm_manage_node.py → roles/lib_openshift/src/ansible/oc_adm_manage_node.py


roles/lib_openshift/src/class/oadm_manage_node.py → roles/lib_openshift/src/class/oc_adm_manage_node.py


+ 3 - 3
roles/lib_openshift/src/doc/manage_node

@@ -3,7 +3,7 @@
 
 DOCUMENTATION = '''
 ---
-module: oadm_manage_node
+module: oc_adm_manage_node
 short_description: Module to manage openshift nodes
 description:
   - Manage openshift nodes programmatically.
@@ -75,13 +75,13 @@ extends_documentation_fragment: []
 
 EXAMPLES = '''
 - name: oadm manage-node --schedulable=true --selector=ops_node=new
-  oadm_manage_node:
+  oc_adm_manage_node:
     selector: ops_node=new
     schedulable: True
   register: schedout
 
 - name: oadm manage-node my-k8s-node-5 --evacuate
-  oadm_manage_node:
+  oc_adm_manage_node:
     node:  my-k8s-node-5
     evacuate: True
     force: True

+ 3 - 3
roles/lib_openshift/src/sources.yml

@@ -9,15 +9,15 @@ oc_adm_ca_server_cert.py:
 - class/oc_adm_ca_server_cert.py
 - ansible/oc_adm_ca_server_cert.py
 
-oadm_manage_node.py:
+oc_adm_manage_node.py:
 - doc/generated
 - doc/license
 - lib/import.py
 - doc/manage_node
 - ../../lib_utils/src/class/yedit.py
 - lib/base.py
-- class/oadm_manage_node.py
-- ansible/oadm_manage_node.py
+- class/oc_adm_manage_node.py
+- ansible/oc_adm_manage_node.py
 
 oc_adm_policy_user.py:
 - doc/generated

+ 4 - 4
roles/lib_openshift/src/test/integration/oadm_manage_node.yml

@@ -1,6 +1,6 @@
 #!/usr/bin/ansible-playbook --module-path=../../../library/
 #
-# ./oadm_manage_node.yml -e "cli_master_test=$OPENSHIFT_MASTER
+# ./oc_adm_manage_node.yml -e "cli_master_test=$OPENSHIFT_MASTER
 ---
 - hosts: "{{ cli_master_test }}"
   gather_facts: no
@@ -17,7 +17,7 @@
       node_to_test: "{{ obj_out['results']['results'][0]['items'][0]['metadata']['name'] }}"
 
   - name: list pods from a node
-    oadm_manage_node:
+    oc_adm_manage_node:
       list_pods: True
       node:
       - "{{ node_to_test }}"
@@ -29,7 +29,7 @@
       msg: Pod data was not returned
 
   - name: set node to unschedulable
-    oadm_manage_node:
+    oc_adm_manage_node:
       schedulable: False
       node:
       - "{{ node_to_test }}"
@@ -56,7 +56,7 @@
       that: nodeout.results.results[0]['spec']['unschedulable']
 
   - name: set node to schedulable
-    oadm_manage_node:
+    oc_adm_manage_node:
       schedulable: True
       node:
       - "{{ node_to_test }}"

+ 7 - 7
roles/lib_openshift/src/test/unit/test_oadm_manage_node.py

@@ -1,5 +1,5 @@
 '''
- Unit tests for oadm_manage_node
+ Unit tests for oc_adm_manage_node
 '''
 
 import os
@@ -16,16 +16,16 @@ import mock
 # place class in our python path
 module_path = os.path.join('/'.join(os.path.realpath(__file__).split('/')[:-4]), 'library')  # noqa: E501
 sys.path.insert(0, module_path)
-from oadm_manage_node import ManageNode, locate_oc_binary  # noqa: E402
+from oc_adm_manage_node import ManageNode, locate_oc_binary  # noqa: E402
 
 
 class ManageNodeTest(unittest.TestCase):
     '''
-     Test class for oadm_manage_node
+     Test class for oc_adm_manage_node
     '''
 
-    @mock.patch('oadm_manage_node.Utils.create_tmpfile_copy')
-    @mock.patch('oadm_manage_node.ManageNode.openshift_cmd')
+    @mock.patch('oc_adm_manage_node.Utils.create_tmpfile_copy')
+    @mock.patch('oc_adm_manage_node.ManageNode.openshift_cmd')
     def test_list_pods(self, mock_openshift_cmd, mock_tmpfile_copy):
         ''' Testing a get '''
         params = {'node': ['ip-172-31-49-140.ec2.internal'],
@@ -107,8 +107,8 @@ class ManageNodeTest(unittest.TestCase):
         # returned 2 pods
         self.assertTrue(len(results['results']['nodes']['ip-172-31-49-140.ec2.internal']) == 2)
 
-    @mock.patch('oadm_manage_node.Utils.create_tmpfile_copy')
-    @mock.patch('oadm_manage_node.ManageNode.openshift_cmd')
+    @mock.patch('oc_adm_manage_node.Utils.create_tmpfile_copy')
+    @mock.patch('oc_adm_manage_node.ManageNode.openshift_cmd')
     def test_schedulable_false(self, mock_openshift_cmd, mock_tmpfile_copy):
         ''' Testing a get '''
         params = {'node': ['ip-172-31-49-140.ec2.internal'],

+ 1 - 1
roles/openshift_manage_node/tasks/main.yml

@@ -39,7 +39,7 @@
   delegate_to: "{{ openshift_master_host }}"
 
 - name: Set node schedulability
-  oadm_manage_node:
+  oc_adm_manage_node:
     node: "{{ openshift.node.nodename | lower }}"
     schedulable: "{{ 'true' if openshift.node.schedulable | bool else 'false' }}"
   retries: 10