* Update targets for CI for devel branch; move some targets to stable-2.10.

* Skipping test on RHEL 8.3 (it is already skipped on RHEL 8.2).

* Linting.

* Shut 2.9/2.10 pylint complaints up.
This commit is contained in:
Felix Fontein 2021-02-11 10:24:58 +01:00 committed by GitHub
commit e9551df5ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 28 additions and 29 deletions

View file

@ -226,10 +226,8 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
if config == 'rootfs' or config.startswith(('virtio', 'sata', 'ide', 'scsi')):
value = ('disk_image=' + value)
if isinstance(value, int) or ',' not in value:
value = value
# split off strings with commas to a dict
else:
if not (isinstance(value, int) or ',' not in value):
# split off strings with commas to a dict
# skip over any keys that cannot be processed
try:
value = dict(key.split("=") for key in value.split(","))

View file

@ -216,7 +216,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
yield host not in v
yield True
return all([found_host for found_host in find_host(host, inventory)])
return all(find_host(host, inventory))
def verify_file(self, path):

View file

@ -130,7 +130,7 @@ class CloudRetry(object):
try:
return f(*args, **kwargs)
except Exception as e:
if isinstance(e, cls.base_class):
if isinstance(e, cls.base_class): # pylint: disable=isinstance-second-argument-not-valid-type
response_code = cls.status_code_from_exception(e)
if cls.found(response_code, catch_extra_error_codes):
msg = "{0}: Retrying in {1} seconds...".format(str(e), delay)

View file

@ -284,7 +284,7 @@ class CmdMixin(object):
def _calculate_args(self, extra_params=None, params=None):
def add_arg_formatted_param(_cmd_args, arg_format, _value):
args = [x for x in arg_format.to_text(_value)]
args = list(arg_format.to_text(_value))
return _cmd_args + args
def find_format(_param):

View file

@ -137,17 +137,13 @@ def main():
host = search_by_name(hosts_service, module.params['host'])
if host is None:
raise Exception("Host '%s' was not found." % module.params['host'])
tags.extend([
tag for tag in hosts_service.host_service(host.id).tags_service().list()
])
tags.extend(hosts_service.host_service(host.id).tags_service().list())
if module.params['vm']:
vms_service = connection.system_service().vms_service()
vm = search_by_name(vms_service, module.params['vm'])
if vm is None:
raise Exception("Vm '%s' was not found." % module.params['vm'])
tags.extend([
tag for tag in vms_service.vm_service(vm.id).tags_service().list()
])
tags.extend(vms_service.vm_service(vm.id).tags_service().list())
if not (module.params['vm'] or module.params['host'] or module.params['name']):
tags = all_tags

View file

@ -164,7 +164,7 @@ def get_package_state(names, pkg_spec, module):
if stdout:
# If the requested package name is just a stem, like "python", we may
# find multiple packages with that name.
pkg_spec[name]['installed_names'] = [installed_name for installed_name in stdout.splitlines()]
pkg_spec[name]['installed_names'] = stdout.splitlines()
module.debug("get_package_state(): installed_names = %s" % pkg_spec[name]['installed_names'])
pkg_spec[name]['installed_state'] = True
else: