aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-12-09 13:22:34 +0100
committerPavel Moravec <pmoravec@redhat.com>2019-12-09 13:22:34 +0100
commit5fbbc63c5e41eab4fe34e3bb2c76abf26023bd55 (patch)
tree7383f3e547c352a2ae39806c20e8794057ef7eb7
parent72562ef482816950e774c3aa5ab803e3b863f524 (diff)
downloadsos-5fbbc63c5e41eab4fe34e3bb2c76abf26023bd55.tar.gz
[foreman] cast dynflow_execution_plans.uuid as varchar
Due to a change in foreman DB scheme, we must explicitly cast dynflow_execution_plans.uuid as a varchar since foreman-tasks 0.15.5 . The explicit casting works well on older versions as well. Resolves: #1882 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/foreman.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py
index c8ed2850..c1546eae 100644
--- a/sos/plugins/foreman.py
+++ b/sos/plugins/foreman.py
@@ -176,22 +176,24 @@ class Foreman(Plugin):
dyncmd = (
'select dynflow_execution_plans.* from foreman_tasks_tasks join '
'dynflow_execution_plans on (foreman_tasks_tasks.external_id = '
- 'dynflow_execution_plans.uuid) where foreman_tasks_tasks.'
+ 'dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.'
'started_at > NOW() - interval %s' % quote(months)
)
dactioncmd = (
'select dynflow_actions.* from foreman_tasks_tasks join '
'dynflow_actions on (foreman_tasks_tasks.external_id = '
- 'dynflow_actions.execution_plan_uuid) where foreman_tasks_tasks.'
- 'started_at > NOW() - interval %s' % quote(months)
+ 'dynflow_actions.execution_plan_uuid::varchar) where '
+ 'foreman_tasks_tasks.started_at > NOW() - interval %s'
+ % quote(months)
)
dstepscmd = (
'select dynflow_steps.* from foreman_tasks_tasks join '
'dynflow_steps on (foreman_tasks_tasks.external_id = '
- 'dynflow_steps.execution_plan_uuid) where foreman_tasks_tasks.'
- 'started_at > NOW() - interval %s' % quote(months)
+ 'dynflow_steps.execution_plan_uuid::varchar) where '
+ 'foreman_tasks_tasks.started_at > NOW() - interval %s'
+ % quote(months)
)
# Populate this dict with DB queries that should be saved directly as