summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/library
diff options
context:
space:
mode:
authorOpenShift Bot <dmcphers+openshiftbot@redhat.com>2017-03-17 12:54:22 -0400
committerGitHub <noreply@github.com>2017-03-17 12:54:22 -0400
commitb6b20207a510bd959b586bbeec9c19a7013a79cf (patch)
tree95aeee0b5892d9687f6edb663f5bb7d4d8d95ce2 /roles/lib_openshift/library
parent622449e15a526dc3276b26fba8aae5256cbeb504 (diff)
parent57b2bfc54e38d90300c21ac73c357817ed1c8f43 (diff)
downloadopenshift-b6b20207a510bd959b586bbeec9c19a7013a79cf.tar.gz
openshift-b6b20207a510bd959b586bbeec9c19a7013a79cf.tar.bz2
openshift-b6b20207a510bd959b586bbeec9c19a7013a79cf.tar.xz
openshift-b6b20207a510bd959b586bbeec9c19a7013a79cf.zip
Merge pull request #3654 from kwoodson/project_fix
Merged by openshift-bot
Diffstat (limited to 'roles/lib_openshift/library')
-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