@@ -98,6 +98,7 @@ def find(request)
9898 end
9999
100100 if is_http_200? ( response )
101+ check_master_version ( response )
101102 content_type , body = parse_response ( response )
102103 result = deserialize_find ( content_type , body )
103104 result . name = request . key if result . respond_to? ( :name= )
@@ -112,7 +113,12 @@ def head(request)
112113 http_head ( request , indirection2uri ( request ) , headers )
113114 end
114115
115- !!is_http_200? ( response )
116+ if is_http_200? ( response )
117+ check_master_version ( response )
118+ true
119+ else
120+ false
121+ end
116122 end
117123
118124 def search ( request )
@@ -121,6 +127,7 @@ def search(request)
121127 end
122128
123129 if is_http_200? ( response )
130+ check_master_version ( response )
124131 content_type , body = parse_response ( response )
125132 deserialize_search ( content_type , body ) || [ ]
126133 else
@@ -136,6 +143,7 @@ def destroy(request)
136143 end
137144
138145 if is_http_200? ( response )
146+ check_master_version ( response )
139147 content_type , body = parse_response ( response )
140148 deserialize_destroy ( content_type , body )
141149 else
@@ -151,6 +159,7 @@ def save(request)
151159 end
152160
153161 if is_http_200? ( response )
162+ check_master_version ( response )
154163 content_type , body = parse_response ( response )
155164 deserialize_save ( content_type , body )
156165 else
@@ -191,6 +200,18 @@ def convert_to_http_error(response)
191200 Net ::HTTPError . new ( message , response )
192201 end
193202
203+ def check_master_version response
204+ if !response [ Puppet ::Network ::HTTP ::HEADER_PUPPET_VERSION ] &&
205+ ( Puppet [ :legacy_query_parameter_serialization ] == false || Puppet [ :report_serialization_format ] != "yaml" )
206+ Puppet . notice "Using less secure serialization of reports and query parameters for compatibility"
207+ Puppet . notice "with older puppet master. To remove this notice, please upgrade your master(s) "
208+ Puppet . notice "to Puppet 3.3 or newer."
209+ Puppet . notice "See http://links.puppetlabs.com/deprecate_yaml_on_network for more information."
210+ Puppet [ :legacy_query_parameter_serialization ] = true
211+ Puppet [ :report_serialization_format ] = "yaml"
212+ end
213+ end
214+
194215 # Returns the content_type, stripping any appended charset, and the
195216 # body, decompressed if necessary (content-encoding is checked inside
196217 # uncompress_body)
0 commit comments