diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2017-03-01 11:04:50 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2017-03-06 09:09:14 -0500 |
commit | 4d8df54bd8449a350e3eba59d9598b50d2e727ff (patch) | |
tree | 8d8ee891e1bd6553abf83da2d2c26b09e2e1b414 /roles/lib_openshift/src/lib/project.py | |
parent | 9ed2463827c2eeb7b5adae9d2878ffbdd81cbc74 (diff) | |
download | openshift-4d8df54bd8449a350e3eba59d9598b50d2e727ff.tar.gz openshift-4d8df54bd8449a350e3eba59d9598b50d2e727ff.tar.bz2 openshift-4d8df54bd8449a350e3eba59d9598b50d2e727ff.tar.xz openshift-4d8df54bd8449a350e3eba59d9598b50d2e727ff.zip |
Fixed docs. Added check for delete failures. Updated namespace to None.
Diffstat (limited to 'roles/lib_openshift/src/lib/project.py')
-rw-r--r-- | roles/lib_openshift/src/lib/project.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/roles/lib_openshift/src/lib/project.py b/roles/lib_openshift/src/lib/project.py index a06f83d78..40994741c 100644 --- a/roles/lib_openshift/src/lib/project.py +++ b/roles/lib_openshift/src/lib/project.py @@ -6,24 +6,25 @@ class ProjectConfig(OpenShiftCLIConfig): ''' project config object ''' def __init__(self, rname, namespace, kubeconfig, project_options): - super(ProjectConfig, self).__init__(rname, rname, kubeconfig, project_options) + super(ProjectConfig, self).__init__(rname, None, kubeconfig, project_options) + class Project(Yedit): ''' Class to wrap the oc command line tools ''' annotations_path = "metadata.annotations" - kind = 'Service' + kind = 'Project' annotation_prefix = 'openshift.io/' def __init__(self, content): - '''Service constructor''' + '''Project constructor''' super(Project, self).__init__(content=content) def get_annotations(self): - ''' get a list of ports ''' + ''' return the annotations''' return self.get(Project.annotations_path) or {} def add_annotations(self, inc_annos): - ''' add a port object to the ports list ''' + ''' add an annotation to the other annotations''' if not isinstance(inc_annos, list): inc_annos = [inc_annos] @@ -38,7 +39,7 @@ class Project(Yedit): return True def find_annotation(self, key): - ''' find a specific port ''' + ''' find an annotation''' annotations = self.get_annotations() for anno in annotations: if Project.annotation_prefix + key == anno: @@ -66,7 +67,7 @@ class Project(Yedit): return removed def update_annotation(self, key, value): - ''' remove an annotation from a project''' + ''' remove an annotation for a project''' annos = self.get(Project.annotations_path) or {} if not annos: |