summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/library/oc_project.py
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-03-14 15:24:11 -0400
committerKenny Woodson <kwoodson@redhat.com>2017-03-16 17:36:09 -0400
commit57b2bfc54e38d90300c21ac73c357817ed1c8f43 (patch)
tree3b8d5bca21324da3ccf8fefd1dafc507c6cf0e3d /roles/lib_openshift/library/oc_project.py
parent866e5bf8581b8468414b7b192537b616d78a42a3 (diff)
downloadopenshift-57b2bfc54e38d90300c21ac73c357817ed1c8f43.tar.gz
openshift-57b2bfc54e38d90300c21ac73c357817ed1c8f43.tar.bz2
openshift-57b2bfc54e38d90300c21ac73c357817ed1c8f43.tar.xz
openshift-57b2bfc54e38d90300c21ac73c357817ed1c8f43.zip
Do not update when properties when not passed.
Diffstat (limited to 'roles/lib_openshift/library/oc_project.py')
-rw-r--r--roles/lib_openshift/library/oc_project.py32
1 files changed, 18 insertions, 14 deletions
diff --git a/roles/lib_openshift/library/oc_project.py b/roles/lib_openshift/library/oc_project.py
index 6091234b9..0d0094c45 100644
--- a/roles/lib_openshift/library/oc_project.py
+++ b/roles/lib_openshift/library/oc_project.py
@@ -1511,30 +1511,34 @@ class OCProject(OpenShiftCLI):
def update(self):
'''update a project '''
- self.project.update_annotation('display-name', self.config.config_options['display_name']['value'])
- self.project.update_annotation('description', self.config.config_options['description']['value'])
+ if self.config.config_options['display_name']['value'] is not None:
+ self.project.update_annotation('display-name', self.config.config_options['display_name']['value'])
+
+ if self.config.config_options['description']['value'] is not None:
+ self.project.update_annotation('description', self.config.config_options['description']['value'])
# work around for immutable project field
- if self.config.config_options['node_selector']['value']:
+ if self.config.config_options['node_selector']['value'] is not None:
self.project.update_annotation('node-selector', self.config.config_options['node_selector']['value'])
- else:
- self.project.update_annotation('node-selector', self.project.find_annotation('node-selector'))
return self._replace_content(self.kind, self.config.name, self.project.yaml_dict)
def needs_update(self):
''' verify an update is needed '''
- result = self.project.find_annotation("display-name")
- if result != self.config.config_options['display_name']['value']:
- return True
+ if self.config.config_options['display_name']['value'] is not None:
+ result = self.project.find_annotation("display-name")
+ if result != self.config.config_options['display_name']['value']:
+ return True
- result = self.project.find_annotation("description")
- if result != self.config.config_options['description']['value']:
- return True
+ if self.config.config_options['description']['value'] is not None:
+ result = self.project.find_annotation("description")
+ if result != self.config.config_options['description']['value']:
+ return True
- result = self.project.find_annotation("node-selector")
- if result != self.config.config_options['node_selector']['value']:
- return True
+ if self.config.config_options['node_selector']['value'] is not None:
+ result = self.project.find_annotation("node-selector")
+ if result != self.config.config_options['node_selector']['value']:
+ return True
return False