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

Fixes for bugs found during testing of 'missing parameters' changeset #64

Merged
merged 5 commits into from
Jun 12, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion library/blivet.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _get_format(self):
fmt = get_format(self._volume['fs_type'],
mountpoint=self._volume.get('mount_point'),
label=self._volume['fs_label'],
options=self._volume['fs_create_options'])
create_options=self._volume['fs_create_options'])
if not fmt.supported or not fmt.formattable:
raise BlivetAnsibleError("required tools for file system '%s' are missing" % self._volume['fs_type'])

Expand Down Expand Up @@ -209,6 +209,8 @@ def _resize(self):
raise BlivetAnsibleError("volume '%s' cannot be resized from %s to %s: %s" % (self._device.name,
self._device.size,
size, str(e)))
elif size and self._device.size != size and not self._device.resizable:
raise BlivetAnsibleError("volume '%s' cannot be resized from %s to %s" % (self._device.name, self._device.size, size))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended that the role fails in this case already in the "get required packages" task, before the actual resizing attempt?


def _reformat(self):
""" Schedule actions as needed to ensure the volume is formatted as specified. """
Expand Down