@@ -188,26 +188,9 @@ impl CollectionBuilder {
188188 & mut self ,
189189 source : & str ,
190190 sp_type : SpType ,
191- slot : u32 ,
191+ sp_slot : u16 ,
192192 sp_state : SpState ,
193193 ) -> Option < Arc < BaseboardId > > {
194- // Much ado about very little: MGS reports that "slot" is a u32, though
195- // in practice this seems very unlikely to be bigger than a u8. (How
196- // many slots can there be within one rack?) The database only supports
197- // signed integers, so if we assumed this really could span the range of
198- // a u32, we'd need to store it in an i64. Instead, assume here that we
199- // can stick it into a u16 (which still seems generous). This will
200- // allow us to store it into an Int32 in the database.
201- let Ok ( sp_slot) = u16:: try_from ( slot) else {
202- self . found_error ( InventoryError :: from ( anyhow ! (
203- "MGS {:?}: SP {:?} slot {}: slot number did not fit into u16" ,
204- source,
205- sp_type,
206- slot
207- ) ) ) ;
208- return None ;
209- } ;
210-
211194 // Normalize the baseboard id: i.e., if we've seen this baseboard
212195 // before, use the same baseboard id record. Otherwise, make a new one.
213196 let baseboard = Self :: normalize_item (
@@ -580,7 +563,6 @@ mod test {
580563 use super :: now_db_precision;
581564 use crate :: examples:: Representative ;
582565 use crate :: examples:: representative;
583- use crate :: examples:: sp_state;
584566 use base64:: Engine ;
585567 use base64:: engine:: general_purpose:: STANDARD as BASE64_STANDARD ;
586568 use gateway_client:: types:: PowerState ;
@@ -1089,15 +1071,6 @@ mod test {
10891071 . unwrap ( ) ;
10901072 assert_eq ! ( sled1_bb, sled1_bb_dup) ;
10911073
1092- // report an SP with an impossible slot number
1093- let sled2_sp = builder. found_sp_state (
1094- "fake MGS 1" ,
1095- SpType :: Sled ,
1096- u32:: from ( u16:: MAX ) + 1 ,
1097- sp_state ( "1" ) ,
1098- ) ;
1099- assert_eq ! ( sled2_sp, None ) ;
1100-
11011074 // report SP caboose for an unknown baseboard
11021075 let bogus_baseboard = BaseboardId {
11031076 part_number : String :: from ( "p1" ) ,
@@ -1309,17 +1282,7 @@ mod test {
13091282 . is_none( )
13101283 ) ;
13111284
1312- // We should see an error.
1313- assert_eq ! (
1314- collection
1315- . errors
1316- . iter( )
1317- . map( |e| format!( "{:#}" , e) )
1318- . collect:: <Vec <_>>( ) ,
1319- vec![
1320- "MGS \" fake MGS 1\" : SP Sled slot 65536: \
1321- slot number did not fit into u16"
1322- ]
1323- ) ;
1285+ // We should see no errors.
1286+ assert ! ( collection. errors. is_empty( ) ) ;
13241287 }
13251288}
0 commit comments