-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New ZFS create fails when you specify mount point #4707
Comments
Files identified in the description:
If these files are incorrect, please update the |
!component =plugins/modules/storage/zfs/zfs.py |
Files identified in the description: If these files are incorrect, please update the |
I am also affected by this problem. It is not just limited to the This problem was not present with release 4.8.1, and was introduced in b9266c3. Specifically this problem comes from the change to line 170 (pre-commit)/167(post-commit): if properties:
for prop, value in properties.items():
if prop == 'volsize':
cmd += ['-V', value]
elif prop == 'volblocksize':
cmd += ['-b', value]
else:
cmd += ['-o', '%s="%s"' % (prop, value)]
if origin and action == 'clone':
cmd.append(origin)
cmd.append(self.name)
- (rc, out, err) = self.module.run_command(' '.join(cmd))
+ self.module.run_command(cmd, check_rc=True) (Note that I've only highlighted the relevant line change in this diff.) Either this single line change can be reverted, or line 163 can be altered to remove the explicit double quotes there, e.g.: if properties:
for prop, value in properties.items():
if prop == 'volsize':
cmd += ['-V', value]
elif prop == 'volblocksize':
cmd += ['-b', value]
else:
- cmd += ['-o', '%s="%s"' % (prop, value)]
+ cmd += ['-o', '%s=%s' % (prop, value)]
if origin and action == 'clone':
cmd.append(origin)
cmd.append(self.name)
self.module.run_command(cmd, check_rc=True) I suspect that the latter change would be more desirable, but I am unfamiliar with this project and unsure about any side-effects that this might have. Hopefully this is somewhat helpful, and sorry for not being confident enough about it to submit a proper PR! |
We should keep the list variant for the arguments, but indeed the quotes need to go. They were needed for the shell to interpret/remove. I unfortunately missed that during the review, sorry for that! |
I've created a PR to fix this in #4726. |
Summary
New ZFS create fails when you specify mount point, all the existing are not affected.
This is because the quotes added to the cmd
'mountpoint="/mnt/spin/test"'
if it
Issue Type
Bug Report
Component Name
plugins/modules/storage/zfs/zfs.py
Ansible Version
Community.general Version
Configuration
OS / Environment
tried on mac and linux
Steps to Reproduce
Task.yaml
community.general.zfs:
name: "{{item}}"
state: present
extra_zfs_properties:
mountpoint={{zfs_base_mount}}{{item}}
loop: "{{ zfsds }}"
Vars.yaml
zfs_base_mount: /mnt/ #keep trailing slash
zfsds:
Expected Results
create and mount zfs
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: