@@ -1940,24 +1940,26 @@ def interface_create(
19401940 return LinodeInterface (self ._client , result ["id" ], self .id , json = result )
19411941
19421942 @property
1943- def interfaces_settings (self ):
1943+ def interfaces_settings (self ) -> LinodeInterfacesSettings :
1944+ """
1945+ The settings for all interfaces under this Linode.
1946+
1947+ :returns: The settings for instance-level interface settings for this Linode.
1948+ """
19441949
19451950 # NOTE: We do not implement this as a Property because Property does
19461951 # not currently have a mechanism for 1:1 sub-entities.
1947- result = self ._client .get (
1948- "{}/interfaces/settings" .format (Instance .api_endpoint ), model = self
1949- )
19501952
1951- if not "network_helper" in result :
1952- raise UnexpectedResponseError (
1953- "Unexpected response when getting settings for Linode interfaces!" ,
1954- json = result ,
1953+ if not hasattr (self , "_interfaces_settings" ):
1954+ self ._set (
1955+ "_interfaces_settings" ,
1956+ # We don't use lazy loading here because it can trigger a known issue
1957+ # where setting fields for updates before the entity has been lazy loaded
1958+ # causes the user's value to be discarded.
1959+ self ._client .load (LinodeInterfacesSettings , self .id ),
19551960 )
19561961
1957- # TODO (Enhanced Interfaces): Error handling for Linodes using legacy interfaces?
1958-
1959- s = LinodeInterfacesSettings (self ._client , self .id , result )
1960- return s
1962+ return self ._interfaces_settings
19611963
19621964 @property
19631965 def interfaces (self ):
0 commit comments