#NEWLINE# def _validate_shared_update( self , context , id , original , updated ) : #NEWLINE# #INDENT# if ( ( updated [ 'shared' ] == original . shared ) or updated [ 'shared' ] ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# ports = self . _model_query ( context , models_v2 . Port ) . filter ( ( models_v2 . Port . network_id == id ) ) #NEWLINE# ports = ports . filter ( not_ ( models_v2 . Port . device_owner . startswith ( constants . DEVICE_OWNER_NETWORK_PREFIX ) ) ) #NEWLINE# subnets = self . _model_query ( context , models_v2 . Subnet ) . filter ( ( models_v2 . Subnet . network_id == id ) ) #NEWLINE# tenant_ids = set ( ( [ port [ 'tenant_id' ] for port in ports ] + [ subnet [ 'tenant_id' ] for subnet in subnets ] ) ) #NEWLINE# if ( ( len ( tenant_ids ) > 1 ) or ( ( len ( tenant_ids ) == 1 ) and ( tenant_ids . pop ( ) != original . tenant_id ) ) ) : #NEWLINE# #INDENT# raise n_exc . InvalidSharedSetting ( network = original . name )