@@ -23,6 +23,8 @@ const (
2323
2424 // Prefix for container network interface names.
2525 containerInterfacePrefix = "eth"
26+ returnCode = 0
27+ returnStr = "Success"
2628)
2729
2830// NetPlugin represents a CNM (libnetwork) network plugin.
@@ -121,7 +123,7 @@ func (plugin *netPlugin) getCapabilities(w http.ResponseWriter, r *http.Request)
121123 resp := getCapabilitiesResponse {Scope : plugin .scope }
122124 err := plugin .Listener .Encode (w , & resp )
123125
124- log .Response (plugin .Name , & resp , err )
126+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
125127}
126128
127129// Handles CreateNetwork requests.
@@ -175,7 +177,7 @@ func (plugin *netPlugin) createNetwork(w http.ResponseWriter, r *http.Request) {
175177 resp := createNetworkResponse {}
176178 err = plugin .Listener .Encode (w , & resp )
177179
178- log .Response (plugin .Name , & resp , err )
180+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
179181}
180182
181183// Handles DeleteNetwork requests.
@@ -200,7 +202,7 @@ func (plugin *netPlugin) deleteNetwork(w http.ResponseWriter, r *http.Request) {
200202 resp := deleteNetworkResponse {}
201203 err = plugin .Listener .Encode (w , & resp )
202204
203- log .Response (plugin .Name , & resp , err )
205+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
204206}
205207
206208// Handles CreateEndpoint requests.
@@ -244,7 +246,7 @@ func (plugin *netPlugin) createEndpoint(w http.ResponseWriter, r *http.Request)
244246
245247 err = plugin .Listener .Encode (w , & resp )
246248
247- log .Response (plugin .Name , & resp , err )
249+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
248250}
249251
250252// Handles DeleteEndpoint requests.
@@ -269,7 +271,7 @@ func (plugin *netPlugin) deleteEndpoint(w http.ResponseWriter, r *http.Request)
269271 resp := deleteEndpointResponse {}
270272 err = plugin .Listener .Encode (w , & resp )
271273
272- log .Response (plugin .Name , & resp , err )
274+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
273275}
274276
275277// Handles Join requests.
@@ -303,7 +305,7 @@ func (plugin *netPlugin) join(w http.ResponseWriter, r *http.Request) {
303305
304306 err = plugin .Listener .Encode (w , & resp )
305307
306- log .Response (plugin .Name , & resp , err )
308+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
307309}
308310
309311// Handles Leave requests.
@@ -328,7 +330,7 @@ func (plugin *netPlugin) leave(w http.ResponseWriter, r *http.Request) {
328330 resp := leaveResponse {}
329331 err = plugin .Listener .Encode (w , & resp )
330332
331- log .Response (plugin .Name , & resp , err )
333+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
332334}
333335
334336// Handles EndpointOperInfo requests.
@@ -353,5 +355,5 @@ func (plugin *netPlugin) endpointOperInfo(w http.ResponseWriter, r *http.Request
353355 resp := endpointOperInfoResponse {Value : epInfo .Data }
354356 err = plugin .Listener .Encode (w , & resp )
355357
356- log .Response (plugin .Name , & resp , err )
358+ log .Response (plugin .Name , & resp , returnCode , returnStr , err )
357359}
0 commit comments