Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2: fix broken nixops check with NVMe #1075

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1484,15 +1484,16 @@ def _check(self, res):
res.disks_ok = True
for device_stored, v in self.block_device_mapping.items():
device_real = device_name_stored_to_real(device_stored)
device_that_boto_expects = device_name_to_boto_expected(device_real) # boto expects only sd names

if device_stored not in instance.block_device_mapping.keys() and v.get('volumeId', None):
if device_that_boto_expects not in instance.block_device_mapping.keys() and v.get('volumeId', None):
res.disks_ok = False
res.messages.append("volume ‘{0}’ not attached to ‘{1}".format(v['volumeId'], device_real))
volume = nixops.ec2_utils.get_volume_by_id(self.connect(), v['volumeId'], allow_missing=True)
if not volume:
res.messages.append("volume ‘{0}’ no longer exists".format(v['volumeId']))

if device_stored in instance.block_device_mapping.keys() and instance.block_device_mapping[device_stored].status != 'attached' :
if device_that_boto_expects in instance.block_device_mapping.keys() and instance.block_device_mapping[device_that_boto_expects].status != 'attached' :
res.disks_ok = False
res.messages.append("volume ‘{0}’ on device ‘{1}’ has unexpected state: ‘{2}".format(v['volumeId'], device_real, instance.block_device_mapping[device_stored].status))

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.