Commit b66f584e authored by Marco Mariani's avatar Marco Mariani

truth testing cleanup

parent 225e6d79
......@@ -119,9 +119,8 @@ class Software(object):
else:
self._install_from_buildout()
# Upload to binary cache if possible and allowed
if (self.software_root and self.url and self.software_url_hash \
and self.upload_binary_cache_url \
and self.upload_binary_dir_url):
if all([self.software_root, self.url, self.software_url_hash,
self.upload_binary_cache_url, self.upload_binary_dir_url]):
blacklisted = False
for url in self.upload_to_binary_cache_url_blacklist:
if self.url.startswith(url):
......@@ -159,7 +158,7 @@ class Software(object):
if (self.signature_private_key_file or
self.upload_cache_url or
self.upload_dir_url is not None):
self.upload_dir_url):
buildout_parameter_list.append('buildout:networkcache-section=networkcache')
for buildout_option, value in [
('%ssignature-private-key-file=%s', self.signature_private_key_file),
......
......@@ -194,7 +194,7 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
if not mandatory_parameter in options:
missing_mandatory_parameter_list.append(mandatory_parameter)
if options.get('all') is True:
if options.get('all'):
options['develop'] = True
if options.get('maximum_periodicity') is not None:
......@@ -238,7 +238,7 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
parser.error('File %r does not exist.' % f)
certificate_repository_path = options.get('certificate_repository_path')
if certificate_repository_path is not None:
if certificate_repository_path:
if not os.path.isdir(certificate_repository_path):
parser.error('Directory %r does not exist' % certificate_repository_path)
......@@ -324,12 +324,10 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
shadir_cert_file=options.get('shadir-cert-file', None),
shadir_key_file=options.get('shadir-key-file', None),
develop=options.get('develop', False),
software_release_filter_list=options.get('only-sr',
# Try to fetch from deprecated argument
options.get('only_sr', None)),
computer_partition_filter_list=options.get('only-cp',
# Try to fetch from deprecated argument
options.get('only_cp', None)),
# Try to fetch from deprecated argument
software_release_filter_list=options.get('only-sr', options.get('only_sr', None)),
# Try to fetch from deprecated argument
computer_partition_filter_list=options.get('only-cp', options.get('only_cp', None)),
force_periodicity = options.get('force_periodicity', False),
maximum_periodicity = options.get('maximum_periodicity', 86400),
),
......
......@@ -108,7 +108,7 @@ class SlapPopen(subprocess.Popen):
output_lines = []
while True:
line = self.stdout.readline()
if line == '' and self.poll() != None:
if line == '' and self.poll() is not None:
break
output_lines.append(line)
logger.info(line.rstrip('\n'))
......@@ -189,7 +189,7 @@ def dropPrivileges(uid, gid):
if uid == 0 or gid == 0:
raise OSError('Dropping privileges to uid = %r or ' \
'gid = %r is too dangerous' % (uid, gid))
if not(current_uid == 0 and current_gid == 0):
if current_uid or current_gid:
logger.debug('Running as uid = %r, gid = %r, dropping not needed and not '
'possible' % (current_uid, current_gid))
return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment