Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
9d594d74
Commit
9d594d74
authored
Feb 22, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2176 from johanwiren/zfs_check
Added support for --check in zfs module
parents
e4ccf2d8
ee517ea5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
library/zfs
+16
-4
No files found.
library/zfs
View file @
9d594d74
...
...
@@ -240,6 +240,9 @@ class Zfs(object):
return
False
def
create
(
self
):
if
self
.
module
.
check_mode
:
self
.
changed
=
True
return
properties
=
self
.
properties
volsize
=
properties
.
pop
(
'volsize'
,
None
)
volblocksize
=
properties
.
pop
(
'volblocksize'
,
None
)
...
...
@@ -266,6 +269,9 @@ class Zfs(object):
self
.
module
.
fail_json
(
msg
=
out
)
def
destroy
(
self
):
if
self
.
module
.
check_mode
:
self
.
changed
=
True
return
cmd
=
[
self
.
module
.
get_bin_path
(
'zfs'
,
True
)]
cmd
.
append
(
'destroy'
)
cmd
.
append
(
self
.
name
)
...
...
@@ -276,6 +282,9 @@ class Zfs(object):
self
.
module
.
fail_json
(
msg
=
out
)
def
set_property
(
self
,
prop
,
value
):
if
self
.
module
.
check_mode
:
self
.
changed
=
True
return
cmd
=
[
self
.
module
.
get_bin_path
(
'zfs'
,
True
)]
cmd
.
append
(
'set'
)
cmd
.
append
(
prop
+
'='
+
value
)
...
...
@@ -356,18 +365,21 @@ def main():
'vscan'
:
{
'required'
:
False
,
'choices'
:[
'on'
,
'off'
]},
'xattr'
:
{
'required'
:
False
,
'choices'
:[
'on'
,
'off'
]},
'zoned'
:
{
'required'
:
False
,
'choices'
:[
'on'
,
'off'
]},
}
},
supports_check_mode
=
True
)
state
=
module
.
params
.
pop
(
'state'
)
name
=
module
.
params
.
pop
(
'name'
)
# Remaining items in module.params are zfs properties
#
Remove 'null' value
properties
#
Get all valid zfs-
properties
properties
=
dict
()
for
prop
,
value
in
module
.
params
.
iteritems
():
if
prop
in
[
'CHECKMODE'
]:
continue
if
value
:
properties
[
prop
]
=
value
result
=
{}
result
[
'name'
]
=
name
result
[
'state'
]
=
state
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment