Commit 7ef75d23 authored by Andrew Roetker's avatar Andrew Roetker

(PDB-2126) Correct improperly named cached_catalog_status field

This commit fixes an issue where the PuppetDB code for the
cached_catalog_status patch incorrectly had the field name as
cached_catalog_reason.
parent a7e54e9d
......@@ -435,9 +435,9 @@
"code_id" {:type :string
:queryable? true
:field :reports.code_id}
"cached_catalog_reason" {:type :string
"cached_catalog_status" {:type :string
:queryable? true
:field :reports.cached_catalog_reason}
:field :reports.cached_catalog_status}
"environment" {:type :string
:queryable? true
:field :environments.environment}
......
......@@ -55,7 +55,7 @@
:transaction_uuid (s/maybe s/Str)
:catalog_uuid (s/maybe s/Str)
:code_id (s/maybe s/Str)
:cached_catalog_reason (s/maybe s/Str)
:cached_catalog_status (s/maybe s/Str)
:metrics [metric-wireformat-schema]
:logs [log-wireformat-schema]
:environment s/Str
......@@ -63,7 +63,7 @@
(def report-v6-wireformat-schema
(-> report-wireformat-schema
(dissoc :catalog_uuid :cached_catalog_reason :code_id)))
(dissoc :catalog_uuid :cached_catalog_status :code_id)))
(def resource-event-v5-wireformat-schema
(-> resource-wireformat-schema
......@@ -143,7 +143,7 @@
(s/optional-key :transaction_uuid) (s/maybe s/Str)
(s/optional-key :catalog_uuid) (s/maybe s/Str)
(s/optional-key :code_id) (s/maybe s/Str)
(s/optional-key :cached_catalog_reason) (s/maybe s/Str)
(s/optional-key :cached_catalog_status) (s/maybe s/Str)
(s/optional-key :status) (s/maybe s/Str)})
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......@@ -192,7 +192,7 @@
[{:keys [transaction_uuid] :as report}]
(utils/assoc-when report
:catalog_uuid transaction_uuid
:cached_catalog_reason nil
:cached_catalog_status nil
:code_id nil))
(defn wire-v5->wire-v7
......
......@@ -1019,7 +1019,7 @@
(defn add-catalog-uuid-to-reports-and-catalogs
[]
(jdbc/do-commands
"ALTER TABLE reports ADD COLUMN cached_catalog_reason TEXT"
"ALTER TABLE reports ADD COLUMN cached_catalog_status TEXT"
"ALTER TABLE reports ADD COLUMN code_id TEXT"
"UPDATE catalogs SET catalog_uuid=catalogs.transaction_uuid WHERE hash is NULL"
"UPDATE reports SET catalog_uuid=reports.transaction_uuid WHERE hash is NULL"))
......
......@@ -1227,7 +1227,7 @@
(let [{:keys [puppet_version certname report_format configuration_version
producer_timestamp start_time end_time transaction_uuid environment
status noop metrics logs resources resource_events catalog_uuid
code_id cached_catalog_reason]
code_id cached_catalog_status]
:as report} (normalize-report orig-report)
report-hash (shash/report-identity-hash report)]
(jdbc/with-db-transaction []
......@@ -1236,7 +1236,7 @@
:transaction_uuid (sutils/munge-uuid-for-storage transaction_uuid)
:catalog_uuid (sutils/munge-uuid-for-storage catalog_uuid)
:code_id code_id
:cached_catalog_reason cached_catalog_reason
:cached_catalog_status cached_catalog_status
:metrics (sutils/munge-jsonb-for-storage metrics)
:logs (sutils/munge-jsonb-for-storage logs)
:resources (sutils/munge-jsonb-for-storage resources)
......
......@@ -12,7 +12,7 @@
:producer_timestamp "2011-01-01T12:11:00-03:00"
:catalog_uuid "5ea3a70b-84c8-426c-813c-dd6492fb829b"
:code_id nil
:cached_catalog_reason "not_used"
:cached_catalog_status "not_used"
:environment "DEV"
:status "unchanged"
:noop false
......@@ -98,7 +98,7 @@
:transaction_uuid "5ea3a70b-84c8-426c-813c-dd6492fb829b"
:catalog_uuid "5ea3a70b-84c8-426c-813c-dd6492fb829b"
:code_id nil
:cached_catalog_reason "not_used"
:cached_catalog_status "not_used"
:configuration_version "bja3985a23"
:start_time "2013-08-28T19:00:00-03:00"
:end_time "2013-08-28T19:10:00-03:00"
......@@ -189,7 +189,7 @@
:producer_timestamp "2011-01-03T12:11:00-03:00"
:catalog_uuid "5ea3a70b-84c8-426c-813c-dd6492fb829b"
:code_id nil
:cached_catalog_reason "not_used"
:cached_catalog_status "not_used"
:environment "DEV"
:status "unchanged"
:noop false
......@@ -272,7 +272,7 @@
:transaction_uuid "e1e561ba-212f-11e3-9d58-60a44c233a9d"
:catalog_uuid "5ea3a70b-84c8-426c-813c-dd6492fb829b"
:code_id nil
:cached_catalog_reason "not_used"
:cached_catalog_status "not_used"
:configuration_version "a81jasj123"
:start_time "2011-01-03T12:00:00-03:00"
:end_time "2011-01-03T12:10:00-03:00"
......
......@@ -35,7 +35,7 @@
(def v5-example-report
(-> reports
:basic
(dissoc :code_id :catalog_uuid :cached_catalog_reason)
(dissoc :code_id :catalog_uuid :cached_catalog_status)
report-query->wire-v5))
(def v4-example-report
......
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