1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix zfs snapshot handling on root zvols (#936)

* Update zfs.py

Added support for snapshots when working with a root zvol that contains no / in its path.

* Added Changelog Fragment
This commit is contained in:
Hobnob 2020-09-28 21:04:24 +01:00 committed by GitHub
parent e5da25915d
commit 13fb60f58f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- zfs - fixed ``invalid character '@' in pool name"`` error when working with snapshots on a root zvol (https://github.com/ansible-collections/community.general/issues/932).

View file

@ -90,7 +90,7 @@ class Zfs(object):
self.changed = False
self.zfs_cmd = module.get_bin_path('zfs', True)
self.zpool_cmd = module.get_bin_path('zpool', True)
self.pool = name.split('/')[0]
self.pool = name.split('/')[0].split('@')[0]
self.is_solaris = os.uname()[0] == 'SunOS'
self.is_openzfs = self.check_openzfs()
self.enhanced_sharing = self.check_enhanced_sharing()