Use a simple way to determine whether a wsme type is null

wsme.Unset has override __nozero__ function, so we can use a simple
way to determine whether a wsme type is null.

Change-Id: I77c38ea811a58524a25873d156d53578246a4976
Closes-Bug: #1477524
This commit is contained in:
Hua Wang 2015-07-16 08:14:32 +08:00
parent f60787bc8b
commit 8405305b0d
1 changed files with 2 additions and 3 deletions

View File

@ -74,9 +74,8 @@ class K8sResourceBase(base.APIBase):
def _get_manifest(self):
if not self.manifest and not self.manifest_url:
return None
if self.manifest is not wsme.Unset and self.manifest is not None:
if self.manifest:
return self.manifest
if (self.manifest_url is not wsme.Unset
and self.manifest_url is not None):
if self.manifest_url:
self.manifest = urlfetch.get(self.manifest_url)
return self.manifest