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
4ee08aaf
Commit
4ee08aaf
authored
Mar 17, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2356 from abulimov/lvol-patch
lvol patch for Debian Squeeze
parents
11d3bd40
a3b44880
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
library/lvol
+4
-5
No files found.
library/lvol
View file @
4ee08aaf
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>
, Alexander Bulimov <lazywolf0@gmail.com>
#
# This file is part of Ansible
#
...
...
@@ -64,7 +64,6 @@ def parse_lvs(data):
lvs
.
append
({
'name'
:
parts
[
0
],
'size'
:
int
(
parts
[
1
]
.
split
(
'.'
)[
0
]),
'path'
:
parts
[
2
],
})
return
lvs
...
...
@@ -90,7 +89,7 @@ def main():
if
size
:
size
=
int
(
size
)
rc
,
current_lvs
,
err
=
module
.
run_command
(
"lvs --noheadings -o lv_name,size
,lv_path
--units m --separator ';'
%
s"
%
(
vg
))
rc
,
current_lvs
,
err
=
module
.
run_command
(
"lvs --noheadings -o lv_name,size --units m --separator ';'
%
s"
%
(
vg
))
if
rc
!=
0
:
module
.
fail_json
(
msg
=
"Volume group
%
s does not exist."
%
vg
,
rc
=
rc
,
err
=
err
)
...
...
@@ -122,7 +121,7 @@ def main():
### remove LV
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
rc
,
_
,
err
=
module
.
run_command
(
"lvremove --force
%
s
"
%
(
this_lv
[
'path
'
]))
rc
,
_
,
err
=
module
.
run_command
(
"lvremove --force
%
s
/
%
s"
%
(
vg
,
this_lv
[
'name
'
]))
if
rc
==
0
:
module
.
exit_json
(
changed
=
True
)
else
:
...
...
@@ -138,7 +137,7 @@ def main():
if
module
.
check_mode
:
changed
=
True
else
:
rc
,
_
,
err
=
module
.
run_command
(
"
%
s -L
%
sm
%
s
"
%
(
tool
,
size
,
this_lv
[
'path
'
]))
rc
,
_
,
err
=
module
.
run_command
(
"
%
s -L
%
sm
%
s
/
%
s"
%
(
tool
,
size
,
vg
,
this_lv
[
'name
'
]))
if
rc
==
0
:
changed
=
True
else
:
...
...
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