Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[foreman] Change scope of tasks history #3437

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sos/report/plugins/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class Foreman(Plugin):
profiles = ('sysmgmt',)
packages = ('foreman',)
option_list = [
PluginOpt('months', default=1,
desc='number of months for dynflow output'),
PluginOpt('days', default=14,
desc='number of days for dynflow output'),
PluginOpt('proxyfeatures', default=False,
desc='collect features of smart proxies'),
PluginOpt('puma-gc', default=False,
Expand Down Expand Up @@ -179,9 +179,9 @@ def setup(self):
self.add_cmd_output(_cmd, suggest_filename='foreman_db_tables_sizes',
env=self.env)

months = '%s months' % self.get_option('months')
days = '%s days' % self.get_option('days')

# Construct the DB queries, using the months option to limit the range
# Construct the DB queries, using the days option to limit the range
# of entries returned

scmd = (
Expand All @@ -198,23 +198,23 @@ def setup(self):
'select dynflow_execution_plans.* from foreman_tasks_tasks join '
'dynflow_execution_plans on (foreman_tasks_tasks.external_id = '
'dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.'
'started_at > NOW() - interval %s' % quote(months)
'started_at > NOW() - interval %s' % quote(days)
)

dactioncmd = (
'select dynflow_actions.* from foreman_tasks_tasks join '
'dynflow_actions on (foreman_tasks_tasks.external_id = '
'dynflow_actions.execution_plan_uuid::varchar) where '
'foreman_tasks_tasks.started_at > NOW() - interval %s'
% quote(months)
% quote(days)
)

dstepscmd = (
'select dynflow_steps.* from foreman_tasks_tasks join '
'dynflow_steps on (foreman_tasks_tasks.external_id = '
'dynflow_steps.execution_plan_uuid::varchar) where '
'foreman_tasks_tasks.started_at > NOW() - interval %s'
% quote(months)
% quote(days)
)

# counts of fact_names prefixes/types: much of one type suggests
Expand Down