@@ -5,7 +5,7 @@ use crate::args::OutputFormat;
5
5
use crate :: util:: { EXIT_DSC_ERROR , EXIT_INVALID_ARGS , EXIT_JSON_ERROR , add_type_name_to_json, write_output} ;
6
6
use dsc_lib:: configure:: config_doc:: { Configuration , ExecutionKind } ;
7
7
use dsc_lib:: configure:: add_resource_export_results_to_configuration;
8
- use dsc_lib:: dscresources:: { resource_manifest :: Kind , invoke_result:: { GetResult , ResourceGetResponse } } ;
8
+ use dsc_lib:: dscresources:: invoke_result:: { GetResult , ResourceGetResponse } ;
9
9
use dsc_lib:: dscerror:: DscError ;
10
10
use tracing:: { error, debug} ;
11
11
@@ -22,11 +22,6 @@ pub fn get(dsc: &DscManager, resource_type: &str, mut input: String, format: &Op
22
22
} ;
23
23
24
24
debug ! ( "resource.type_name - {} implemented_as - {:?}" , resource. type_name, resource. implemented_as) ;
25
- if resource. kind == Kind :: Adapter {
26
- error ! ( "Can not perform this operation on the adapter {} itself" , resource. type_name) ;
27
- exit ( EXIT_DSC_ERROR ) ;
28
- }
29
-
30
25
if let Some ( requires) = & resource. require_adapter {
31
26
input = add_type_name_to_json ( input, resource. type_name . clone ( ) ) ;
32
27
if let Some ( pr) = get_resource ( dsc, requires) {
@@ -64,11 +59,6 @@ pub fn get_all(dsc: &DscManager, resource_type: &str, format: &Option<OutputForm
64
59
} ;
65
60
66
61
debug ! ( "resource.type_name - {} implemented_as - {:?}" , resource. type_name, resource. implemented_as) ;
67
- if resource. kind == Kind :: Adapter {
68
- error ! ( "Can not perform this operation on the adapter {} itself" , resource. type_name) ;
69
- exit ( EXIT_DSC_ERROR ) ;
70
- }
71
-
72
62
if let Some ( requires) = & resource. require_adapter {
73
63
input = add_type_name_to_json ( input, resource. type_name . clone ( ) ) ;
74
64
if let Some ( pr) = get_resource ( dsc, requires) {
@@ -116,10 +106,6 @@ pub fn set(dsc: &DscManager, resource_type: &str, mut input: String, format: &Op
116
106
} ;
117
107
118
108
debug ! ( "resource.type_name - {} implemented_as - {:?}" , resource. type_name, resource. implemented_as) ;
119
- if resource. kind == Kind :: Adapter {
120
- error ! ( "Can not perform this operation on the adapter {} itself" , resource. type_name) ;
121
- exit ( EXIT_DSC_ERROR ) ;
122
- }
123
109
124
110
if let Some ( requires) = & resource. require_adapter {
125
111
input = add_type_name_to_json ( input, resource. type_name . clone ( ) ) ;
@@ -162,10 +148,6 @@ pub fn test(dsc: &DscManager, resource_type: &str, mut input: String, format: &O
162
148
} ;
163
149
164
150
debug ! ( "resource.type_name - {} implemented_as - {:?}" , resource. type_name, resource. implemented_as) ;
165
- if resource. kind == Kind :: Adapter {
166
- error ! ( "Can not perform this operation on the adapter {} itself" , resource. type_name) ;
167
- exit ( EXIT_DSC_ERROR ) ;
168
- }
169
151
170
152
if let Some ( requires) = & resource. require_adapter {
171
153
input = add_type_name_to_json ( input, resource. type_name . clone ( ) ) ;
@@ -203,10 +185,6 @@ pub fn delete(dsc: &DscManager, resource_type: &str, mut input: String) {
203
185
} ;
204
186
205
187
debug ! ( "resource.type_name - {} implemented_as - {:?}" , resource. type_name, resource. implemented_as) ;
206
- if resource. kind == Kind :: Adapter {
207
- error ! ( "Can not perform this operation on the adapter {} itself" , resource. type_name) ;
208
- exit ( EXIT_DSC_ERROR ) ;
209
- }
210
188
211
189
if let Some ( requires) = & resource. require_adapter {
212
190
input = add_type_name_to_json ( input, resource. type_name . clone ( ) ) ;
@@ -232,11 +210,6 @@ pub fn schema(dsc: &DscManager, resource_type: &str, format: &Option<OutputForma
232
210
error ! ( "{}" , DscError :: ResourceNotFound ( resource_type. to_string( ) ) . to_string( ) ) ;
233
211
return
234
212
} ;
235
- if resource. kind == Kind :: Adapter {
236
- error ! ( "Can not perform this operation on the adapter {} itself" , resource. type_name) ;
237
- exit ( EXIT_DSC_ERROR ) ;
238
- }
239
-
240
213
match resource. schema ( ) {
241
214
Ok ( json) => {
242
215
// verify is json
@@ -263,11 +236,6 @@ pub fn export(dsc: &mut DscManager, resource_type: &str, format: &Option<OutputF
263
236
return
264
237
} ;
265
238
266
- if dsc_resource. kind == Kind :: Adapter {
267
- error ! ( "Can not perform this operation on the adapter {} itself" , dsc_resource. type_name) ;
268
- exit ( EXIT_DSC_ERROR ) ;
269
- }
270
-
271
239
let mut adapter_resource: Option < & DscResource > = None ;
272
240
if let Some ( requires) = & dsc_resource. require_adapter {
273
241
input = add_type_name_to_json ( input, dsc_resource. type_name . clone ( ) ) ;
0 commit comments