Commit b66f584e authored by Marco Mariani's avatar Marco Mariani

truth testing cleanup

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