summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-03-29 11:27:30 -0400
committerKenny Woodson <kwoodson@redhat.com>2017-03-29 11:27:30 -0400
commita8e180943aa3bd1692507f5ecd4126b7993202c6 (patch)
tree999eaa5def9e9e142679ba3768e65a387eda84c3
parent9b4530d8e0be3aa96fd24cc3e7cab67257ff836d (diff)
downloadopenshift-a8e180943aa3bd1692507f5ecd4126b7993202c6.tar.gz
openshift-a8e180943aa3bd1692507f5ecd4126b7993202c6.tar.bz2
openshift-a8e180943aa3bd1692507f5ecd4126b7993202c6.tar.xz
openshift-a8e180943aa3bd1692507f5ecd4126b7993202c6.zip
Fixed docs. Fixed add_resource.
-rw-r--r--roles/lib_openshift/library/oc_clusterrole.py11
-rw-r--r--roles/lib_openshift/src/lib/clusterrole.py2
-rw-r--r--roles/lib_openshift/src/lib/rule.py9
3 files changed, 12 insertions, 10 deletions
diff --git a/roles/lib_openshift/library/oc_clusterrole.py b/roles/lib_openshift/library/oc_clusterrole.py
index b94137d30..8bd8a2ccd 100644
--- a/roles/lib_openshift/library/oc_clusterrole.py
+++ b/roles/lib_openshift/library/oc_clusterrole.py
@@ -1438,6 +1438,7 @@ class Rule(object):
def add_resource(self, inc_resource):
'''add an resource to the resources array'''
+ self.resources.append(inc_resource)
def remove_verb(self, inc_verb):
'''add a verb to the verbs array'''
@@ -1471,10 +1472,10 @@ class Rule(object):
def __eq__(self, other):
'''return whether rules are equal'''
- return self.attribute_restrictions == other.attribute_restrictions and \
- self.api_groups == other.api_groups and \
- self.resources == other.resources and \
- self.verbs == other.verbs
+ return (self.attribute_restrictions == other.attribute_restrictions and
+ self.api_groups == other.api_groups and
+ self.resources == other.resources and
+ self.verbs == other.verbs)
@staticmethod
@@ -1497,7 +1498,7 @@ class Rule(object):
# pylint: disable=too-many-public-methods
class ClusterRole(Yedit):
- ''' Class to model an openshift DeploymentConfig'''
+ ''' Class to model an openshift ClusterRole'''
rules_path = "rules"
def __init__(self, name=None, content=None):
diff --git a/roles/lib_openshift/src/lib/clusterrole.py b/roles/lib_openshift/src/lib/clusterrole.py
index 8207fbc38..93ffababf 100644
--- a/roles/lib_openshift/src/lib/clusterrole.py
+++ b/roles/lib_openshift/src/lib/clusterrole.py
@@ -4,7 +4,7 @@
# pylint: disable=too-many-public-methods
class ClusterRole(Yedit):
- ''' Class to model an openshift DeploymentConfig'''
+ ''' Class to model an openshift ClusterRole'''
rules_path = "rules"
def __init__(self, name=None, content=None):
diff --git a/roles/lib_openshift/src/lib/rule.py b/roles/lib_openshift/src/lib/rule.py
index 628129832..d1e900427 100644
--- a/roles/lib_openshift/src/lib/rule.py
+++ b/roles/lib_openshift/src/lib/rule.py
@@ -90,6 +90,7 @@ class Rule(object):
def add_resource(self, inc_resource):
'''add an resource to the resources array'''
+ self.resources.append(inc_resource)
def remove_verb(self, inc_verb):
'''add a verb to the verbs array'''
@@ -123,10 +124,10 @@ class Rule(object):
def __eq__(self, other):
'''return whether rules are equal'''
- return self.attribute_restrictions == other.attribute_restrictions and \
- self.api_groups == other.api_groups and \
- self.resources == other.resources and \
- self.verbs == other.verbs
+ return (self.attribute_restrictions == other.attribute_restrictions and
+ self.api_groups == other.api_groups and
+ self.resources == other.resources and
+ self.verbs == other.verbs)
@staticmethod