File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1551,10 +1551,12 @@ def create( # noqa: C901
1551
1551
1552
1552
# Detect if volumes were manually detached. If so, reattach
1553
1553
# them.
1554
+ mapped_devices = self ._get_instance ().block_device_mapping .keys ()
1555
+
1554
1556
for device_stored , v in self .block_device_mapping .items ():
1555
1557
if (
1556
- device_name_to_boto_expected (device_stored )
1557
- not in self . _get_instance (). block_device_mapping . keys ()
1558
+ device_name_to_boto_expected (device_stored ) not in mapped_devices
1559
+ and device_stored not in mapped_devices
1558
1560
and not v .get ("needsAttach" , False )
1559
1561
and v .get ("volumeId" , None )
1560
1562
):
@@ -2041,8 +2043,12 @@ def _check(self, res):
2041
2043
device_real
2042
2044
) # boto expects only sd names
2043
2045
2044
- if device_that_boto_expects not in instance .block_device_mapping .keys () and v .get (
2045
- "volumeId" , None
2046
+ mapped_devices = instance .block_device_mapping .keys ()
2047
+
2048
+ if (
2049
+ device_that_boto_expects not in mapped_devices
2050
+ and device_real not in mapped_devices
2051
+ and v .get ("volumeId" , None )
2046
2052
):
2047
2053
res .disks_ok = False
2048
2054
res .messages .append (
You can’t perform that action at this time.
0 commit comments