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):
7575 _computed_path : Optional [str ]
7676 _from_parent_attrs : Dict [str , Any ]
7777 _obj_cls : Optional [Type [base .RESTObject ]]
78+ _optional_get_attrs : Tuple [str , ...] = ()
7879 _parent : Optional [base .RESTObject ]
7980 _parent_attrs : Dict [str , Any ]
8081 _path : Optional [str ]
@@ -119,6 +120,7 @@ class GetWithoutIdMixin(_RestManagerBase):
119120 _computed_path : Optional [str ]
120121 _from_parent_attrs : Dict [str , Any ]
121122 _obj_cls : Optional [Type [base .RESTObject ]]
123+ _optional_get_attrs : Tuple [str , ...] = ()
122124 _parent : Optional [base .RESTObject ]
123125 _parent_attrs : Dict [str , Any ]
124126 _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):
165165 id_attr = cls ._id_attr .replace ("_" , "-" )
166166 sub_parser_action .add_argument ("--%s" % id_attr , required = True )
167167
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+ )
175172
176173 if action_name == "create" :
177174 for x in mgr_cls ._create_attrs .required :
You can’t perform that action at this time.
0 commit comments