summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/lib
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-02-17 15:11:51 -0500
committerKenny Woodson <kwoodson@redhat.com>2017-02-20 16:13:40 -0500
commit35583f57c71db5b181d0eaefc0bfc620c3790535 (patch)
treec86e81b33792c3322c49145923e0f82491e80052 /roles/lib_openshift/src/lib
parent89ef5753535918a17a16c22c7bca56054229514f (diff)
downloadopenshift-35583f57c71db5b181d0eaefc0bfc620c3790535.tar.gz
openshift-35583f57c71db5b181d0eaefc0bfc620c3790535.tar.bz2
openshift-35583f57c71db5b181d0eaefc0bfc620c3790535.tar.xz
openshift-35583f57c71db5b181d0eaefc0bfc620c3790535.zip
Renamed modules, fixed docs, renamed variables, and cleaned up logic.
Diffstat (limited to 'roles/lib_openshift/src/lib')
-rw-r--r--roles/lib_openshift/src/lib/deploymentconfig.py2
-rw-r--r--roles/lib_openshift/src/lib/replicationcontroller.py7
-rw-r--r--roles/lib_openshift/src/lib/rolebinding.py12
-rw-r--r--roles/lib_openshift/src/lib/secret.py2
-rw-r--r--roles/lib_openshift/src/lib/serviceaccount.py2
-rw-r--r--roles/lib_openshift/src/lib/volume.py2
6 files changed, 16 insertions, 11 deletions
diff --git a/roles/lib_openshift/src/lib/deploymentconfig.py b/roles/lib_openshift/src/lib/deploymentconfig.py
index e060d3707..f10c6bb8b 100644
--- a/roles/lib_openshift/src/lib/deploymentconfig.py
+++ b/roles/lib_openshift/src/lib/deploymentconfig.py
@@ -4,7 +4,7 @@
# pylint: disable=too-many-public-methods
class DeploymentConfig(Yedit):
- ''' Class to wrap the oc command line tools '''
+ ''' Class to model an openshift DeploymentConfig'''
default_deployment_config = '''
apiVersion: v1
kind: DeploymentConfig
diff --git a/roles/lib_openshift/src/lib/replicationcontroller.py b/roles/lib_openshift/src/lib/replicationcontroller.py
index ae585a986..8bcc1e3cc 100644
--- a/roles/lib_openshift/src/lib/replicationcontroller.py
+++ b/roles/lib_openshift/src/lib/replicationcontroller.py
@@ -4,7 +4,12 @@
# pylint: disable=too-many-public-methods
class ReplicationController(DeploymentConfig):
- ''' Class to wrap the oc command line tools '''
+ ''' Class to model a replicationcontroller openshift object.
+
+ Currently we are modeled after a deployment config since they
+ are very similar. In the future, when the need arises we
+ will add functionality to this class.
+ '''
replicas_path = "spec.replicas"
env_path = "spec.template.spec.containers[0].env"
volumes_path = "spec.template.spec.volumes"
diff --git a/roles/lib_openshift/src/lib/rolebinding.py b/roles/lib_openshift/src/lib/rolebinding.py
index bbc1bb956..0835c9254 100644
--- a/roles/lib_openshift/src/lib/rolebinding.py
+++ b/roles/lib_openshift/src/lib/rolebinding.py
@@ -2,19 +2,19 @@
# pylint: disable=too-many-instance-attributes
class RoleBindingConfig(object):
- ''' Handle route options '''
+ ''' Handle rolebinding config '''
# pylint: disable=too-many-arguments
def __init__(self,
- sname,
+ name,
namespace,
kubeconfig,
group_names=None,
role_ref=None,
subjects=None,
usernames=None):
- ''' constructor for handling route options '''
+ ''' constructor for handling rolebinding options '''
self.kubeconfig = kubeconfig
- self.name = sname
+ self.name = name
self.namespace = namespace
self.group_names = group_names
self.role_ref = role_ref
@@ -25,7 +25,7 @@ class RoleBindingConfig(object):
self.create_dict()
def create_dict(self):
- ''' return a service as a dict '''
+ ''' create a default rolebinding as a dict '''
self.data['apiVersion'] = 'v1'
self.data['kind'] = 'RoleBinding'
self.data['groupNames'] = self.group_names
@@ -39,7 +39,7 @@ class RoleBindingConfig(object):
# pylint: disable=too-many-instance-attributes,too-many-public-methods
class RoleBinding(Yedit):
- ''' Class to wrap the oc command line tools '''
+ ''' Class to model a rolebinding openshift object'''
group_names_path = "groupNames"
role_ref_path = "roleRef"
subjects_path = "subjects"
diff --git a/roles/lib_openshift/src/lib/secret.py b/roles/lib_openshift/src/lib/secret.py
index 1ba78ddd5..32e67152d 100644
--- a/roles/lib_openshift/src/lib/secret.py
+++ b/roles/lib_openshift/src/lib/secret.py
@@ -20,7 +20,7 @@ class SecretConfig(object):
self.create_dict()
def create_dict(self):
- ''' return a secret as a dict '''
+ ''' instantiate a secret as a dict '''
self.data['apiVersion'] = 'v1'
self.data['kind'] = 'Secret'
self.data['metadata'] = {}
diff --git a/roles/lib_openshift/src/lib/serviceaccount.py b/roles/lib_openshift/src/lib/serviceaccount.py
index 47a55757e..50c104d44 100644
--- a/roles/lib_openshift/src/lib/serviceaccount.py
+++ b/roles/lib_openshift/src/lib/serviceaccount.py
@@ -18,7 +18,7 @@ class ServiceAccountConfig(object):
self.create_dict()
def create_dict(self):
- ''' return a properly structured volume '''
+ ''' instantiate a properly structured volume '''
self.data['apiVersion'] = 'v1'
self.data['kind'] = 'ServiceAccount'
self.data['metadata'] = {}
diff --git a/roles/lib_openshift/src/lib/volume.py b/roles/lib_openshift/src/lib/volume.py
index dc07d3ce1..fd47fa5c5 100644
--- a/roles/lib_openshift/src/lib/volume.py
+++ b/roles/lib_openshift/src/lib/volume.py
@@ -1,7 +1,7 @@
# pylint: skip-file
class Volume(object):
- ''' Class to wrap the oc command line tools '''
+ ''' Class to model an openshift volume object'''
volume_mounts_path = {"pod": "spec.containers[0].volumeMounts",
"dc": "spec.template.spec.containers[0].volumeMounts",
"rc": "spec.template.spec.containers[0].volumeMounts",