Merge pull request #4396 from jladdjr/foreman_script_should_not_use_reports_3.7.1

disable reports option for foreman (release_3.7.1)
This commit is contained in:
Ryan Petrello 2020-06-10 08:30:14 -04:00 committed by GitHub
commit 7c1959010a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,8 +176,6 @@ class ForemanInventory(object):
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
self.want_facts = True
self.want_facts = self.want_facts and self.report_want_facts
try:
self.want_hostcollections = config.getboolean('ansible', 'want_hostcollections')
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
@ -272,12 +270,11 @@ class ForemanInventory(object):
return results
def _use_inventory_report(self):
if not self.foreman_use_reports_api:
return False
status_url = "%s/api/v2/status" % self.foreman_url
result = self._get_json(status_url)
foreman_version = (LooseVersion(result.get('version')) >= LooseVersion('1.24.0'))
return foreman_version
# The options required to enable the reports feature have never been fully
# surfaced by awx. Disabling reports in the foreman script altogether.
# Given that this script is being deprecated in favor of the foreman _plugin_,
# reports should be enabled for the foreman plugin in future version of awx.
return False
def _fetch_params(self):
options, params = ("no", "yes"), dict()