Permalink
Browse files

Replace "if not ..." by "if ... is None"

  • Loading branch information...
1 parent 51b35dc commit 98b7b6fec6128eed61cccd578f4d1d0a9adbc6a1 @priteau priteau committed Mar 25, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 epu/dtrs/core.py
View
@@ -20,7 +20,7 @@ def __init__(self, store):
def add_credentials(self, caller, site_name, site_credentials):
site = self.store.describe_site(site_name)
- if not site:
+ if site is None:
raise NotFoundError("Cannot add credentials for unknown site %s" % site_name)
log.debug("Adding credentials fo site %s user %s" % (site_name, caller))
@@ -43,7 +43,7 @@ def lookup(self, caller, dt_name, dtrs_request_node, vars):
log.debug("lookup dt %s for user %s" % (dt_name, caller))
dt = self.store.describe_dt(caller, dt_name)
- if not dt:
+ if dt is None:
raise DeployableTypeLookupError("Unknown deployable type name: %s" % dt_name)
# dtrs_request_node contains:
@@ -76,7 +76,7 @@ def lookup(self, caller, dt_name, dtrs_request_node, vars):
iaas_allocation = allocation
site_credentials = self.store.describe_credentials(caller, site)
- if not site_credentials:
+ if site_credentials is None:
raise DeployableTypeLookupError('Credentials missing for caller %s and site %s', caller, site)
try:

0 comments on commit 98b7b6f

Please sign in to comment.