mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
linux_lvm.lvresize module - change return type
This commit is contained in:
parent
a6452e0561
commit
cd21355787
@ -5,6 +5,7 @@ Support for Linux LVM2
|
|||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Import python libs
|
# Import python libs
|
||||||
|
import logging
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
@ -12,6 +13,9 @@ import salt.utils.path
|
|||||||
from salt.ext import six
|
from salt.ext import six
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
|
# Set up logger
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Define the module's virtual name
|
# Define the module's virtual name
|
||||||
__virtualname__ = 'lvm'
|
__virtualname__ = 'lvm'
|
||||||
|
|
||||||
@ -490,7 +494,8 @@ def lvresize(size=None, lvpath=None, extents=None):
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
if size and extents:
|
if size and extents:
|
||||||
return 'Error: Please specify only one of size or extents'
|
log.error('Error: Please specify only one of size or extents')
|
||||||
|
return {}
|
||||||
|
|
||||||
cmd = ['lvresize']
|
cmd = ['lvresize']
|
||||||
|
|
||||||
@ -499,7 +504,8 @@ def lvresize(size=None, lvpath=None, extents=None):
|
|||||||
elif extents:
|
elif extents:
|
||||||
cmd.extend(['-l', '{0}'.format(extents)])
|
cmd.extend(['-l', '{0}'.format(extents)])
|
||||||
else:
|
else:
|
||||||
return 'Error: Either size or extents must be specified'
|
log.error('Error: Either size or extents must be specified')
|
||||||
|
return {}
|
||||||
|
|
||||||
cmd.append(lvpath)
|
cmd.append(lvpath)
|
||||||
cmd_ret = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
|
cmd_ret = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
|
||||||
|
Loading…
Reference in New Issue
Block a user