File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ class GetMixin(_RestManagerBase):
75
75
_computed_path : Optional [str ]
76
76
_from_parent_attrs : Dict [str , Any ]
77
77
_obj_cls : Optional [Type [base .RESTObject ]]
78
+ _optional_get_attrs : Tuple [str , ...] = ()
78
79
_parent : Optional [base .RESTObject ]
79
80
_parent_attrs : Dict [str , Any ]
80
81
_path : Optional [str ]
@@ -119,6 +120,7 @@ class GetWithoutIdMixin(_RestManagerBase):
119
120
_computed_path : Optional [str ]
120
121
_from_parent_attrs : Dict [str , Any ]
121
122
_obj_cls : Optional [Type [base .RESTObject ]]
123
+ _optional_get_attrs : Tuple [str , ...] = ()
122
124
_parent : Optional [base .RESTObject ]
123
125
_parent_attrs : Dict [str , Any ]
124
126
_path : Optional [str ]
Original file line number Diff line number Diff line change @@ -165,13 +165,10 @@ def _populate_sub_parser_by_class(cls, sub_parser):
165
165
id_attr = cls ._id_attr .replace ("_" , "-" )
166
166
sub_parser_action .add_argument ("--%s" % id_attr , required = True )
167
167
168
- if hasattr (mgr_cls , "_optional_get_attrs" ):
169
- [
170
- sub_parser_action .add_argument (
171
- "--%s" % x .replace ("_" , "-" ), required = False
172
- )
173
- for x in mgr_cls ._optional_get_attrs
174
- ]
168
+ for x in mgr_cls ._optional_get_attrs :
169
+ sub_parser_action .add_argument (
170
+ "--%s" % x .replace ("_" , "-" ), required = False
171
+ )
175
172
176
173
if action_name == "create" :
177
174
for x in mgr_cls ._create_attrs .required :
You can’t perform that action at this time.
0 commit comments